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

public class FeatureHasher extends Object implements FeatureTransformer
Hashes the feature names to reduce the dimensionality.

Uses murmurhash3_x86_32 as the hashing function for the feature names.

  • Constructor Summary

    Constructors
    Constructor
    Description
    FeatureHasher(int dimension)
    Constructs a feature hasher using the supplied hash dimension.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
     
    map(String tag, List<Feature> features)
    Transforms features into a new list of features

    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

      public List<Feature> map(String tag, List<Feature> features)
      Description copied from interface: FeatureTransformer
      Transforms features into a new list of features
      Specified by:
      map in interface FeatureTransformer
      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 interface com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>