Package org.tribuo.data.text.impl
Class FeatureHasher
java.lang.Object
org.tribuo.data.text.impl.FeatureHasher
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,FeatureTransformer
Hashes the feature names to reduce the dimensionality.
Uses murmurhash3_x86_32 as the hashing function for the feature names.
-
Constructor Summary
ConstructorDescriptionFeatureHasher
(int dimension) Constructs a feature hasher using the supplied hash dimension. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.oracle.labs.mlrg.olcut.config.Configurable
postConfig
-
Constructor Details
-
FeatureHasher
public FeatureHasher(int dimension) Constructs a feature hasher using the supplied hash dimension.- Parameters:
dimension
- The dimension to reduce the hashed features into.
-
-
Method Details
-
map
Description copied from interface:FeatureTransformer
Transforms features into a new list of features- Specified by:
map
in interfaceFeatureTransformer
- Parameters:
tag
- The feature name tag.features
- The features to transform.- Returns:
- The transformed features.
-
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance()- Specified by:
getProvenance
in interfacecom.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
-