bfgray3 / cattonum

Encode Categorical Features (unmaintained)
https://CRAN.R-project.org/package=cattonum
Other
32 stars 4 forks source link

add feature hashing? #3

Closed bfgray3 closed 5 years ago

bfgray3 commented 6 years ago

want functionality similar to https://github.com/scikit-learn/scikit-learn/blob/a24c8b464d094d2c468a16ea9f8bf8d42d949f84/sklearn/feature_extraction/_hashing.pyx.

bfgray3 commented 6 years ago

from http://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.FeatureHasher.html:

>>> from sklearn.feature_extraction import FeatureHasher
>>> h = FeatureHasher(n_features=10)
>>> D = [{'dog': 1, 'cat':2, 'elephant':4},{'dog': 2, 'run': 5}]
>>> f = h.transform(D)
>>> f.toarray()
array([[ 0.,  0., -4., -1.,  0.,  0.,  0.,  0.,  0.,  2.],
       [ 0.,  0.,  0., -2., -5.,  0.,  0.,  0.,  0.,  0.]])
bfgray3 commented 6 years ago
bfgray3 commented 5 years ago

not going to do this for now