Package org.tribuo.hash
Class ModHashCodeHasher
java.lang.Object
org.tribuo.hash.Hasher
org.tribuo.hash.ModHashCodeHasher
- All Implemented Interfaces:
com.oracle.labs.mlrg.olcut.config.Configurable
,com.oracle.labs.mlrg.olcut.provenance.Provenancable<com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance>
,Serializable
Hashes names using String.hashCode(), then reduces the dimension.
- See Also:
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.tribuo.hash.Hasher
MIN_LENGTH
-
Constructor Summary
ConstructorDescriptionModHashCodeHasher
(int dimension, String salt) Constructs a ModHashCodeHasher with the supplied parameters.ModHashCodeHasher
(String salt) Constructs a ModHashCodeHasher with a fixed dimensionality of 100. -
Method Summary
Modifier and TypeMethodDescriptioncom.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance
Hashes the supplied input using the hashing function.void
Used by the OLCUT configuration system, and should not be called by external code.void
The salt is transient, it must be set **to the same value as it was trained with** after theModel
is deserialized.toString()
Methods inherited from class org.tribuo.hash.Hasher
validateSalt
-
Constructor Details
-
ModHashCodeHasher
Constructs a ModHashCodeHasher with a fixed dimensionality of 100.- Parameters:
salt
- The salt value.
-
ModHashCodeHasher
Constructs a ModHashCodeHasher with the supplied parameters.- Parameters:
dimension
- The dimensionality.salt
- The salt value.
-
-
Method Details
-
postConfig
public void postConfig() throws com.oracle.labs.mlrg.olcut.config.PropertyExceptionUsed by the OLCUT configuration system, and should not be called by external code.- Throws:
com.oracle.labs.mlrg.olcut.config.PropertyException
-
hash
Description copied from class:Hasher
Hashes the supplied input using the hashing function. -
setSalt
Description copied from class:Hasher
The salt is transient, it must be set **to the same value as it was trained with** after theModel
is deserialized. -
getProvenance
public com.oracle.labs.mlrg.olcut.provenance.ConfiguredObjectProvenance getProvenance() -
toString
-