public final class HashedFeatureMap extends ImmutableFeatureMap
FeatureMapused by the
HashingTrainerto provide feature name hashing and guarantee that the
Modeldoes not contain feature name information, but still works with unhashed features names.
|Modifier and Type||Method and Description|
Gets the id number for this feature, returns -1 if it's unknown.
The salt is not serialised with the
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public VariableIDInfo get(String name)
VariableIDInfofor this name. Returns null if it's unknown.
public int getID(String name)
public void setSalt(String salt)
Model. It must be set after deserialisation to the same value from training time.
If the salt is invalid it will throw
salt- The salt value. Must be the same as the one from training time.
public static HashedFeatureMap generateHashedFeatureMap(FeatureMap map, Hasher hasher)
FeatureMapby hashing each entry using the supplied hash function
This preserves the index ordering of the original feature names, which is important for making sure test time performance is good.
It guarantees any collisions will produce an feature id number lower than the previous feature's number, and so can be easily removed.
Copyright © 2015–2021 Oracle and/or its affiliates. All rights reserved.