K- Type of a key in
V- Type of a value in
public final class StringEncoderPreprocessor<K,V> extends EncoderPreprocessor<K,V> implements DeployableObject
This preprocessor can transform multiple columns which indices are handled during training process. These indexes could be defined via .withEncodedFeature(featureIndex) call.
NOTE: it does not add new column but change data in-place.
There is only a one strategy regarding how StringEncoder will handle unseen labels when you have fit a StringEncoder on one dataset and then use it to transform another: put unseen labels in a special additional bucket, at index is equal amountOfCategories.
|Constructor and Description|
Constructs a new instance of String Encoder preprocessor.
|Modifier and Type||Method and Description|
Applies this preprocessor.
Returns dependencies of this object that can be object with class defined by client side and unknown for server.
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public StringEncoderPreprocessor(Map<String,Integer> encodingValues, Preprocessor<K,V> basePreprocessor, Set<Integer> handledIndices)
basePreprocessor- Base preprocessor.
handledIndices- Handled indices.
public LabeledVector apply(K k, V v)