Package ai.sklearn4j.preprocessing.label
Class LabelEncoder
- java.lang.Object
-
- ai.sklearn4j.base.TransformerMixin<List<Object>,NumpyArray<Long>>
-
- ai.sklearn4j.preprocessing.label.LabelEncoder
-
public class LabelEncoder extends TransformerMixin<List<Object>,NumpyArray<Long>>
Encode target labels with value between 0 and n_classes-1. This transformer should be used to encode target values, *i.e.* `y`, and not the input `X`.
-
-
Constructor Summary
Constructors Constructor Description LabelEncoder()Instantiate a new object of LabelEncoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Object>getClasses()Gets the label for each class.List<Object>inverseTransform(NumpyArray<Long> array)Takes a transformed array and reveres the transformation.voidsetClasses(List<Object> value)Sets the label for each class.NumpyArray<Long>transform(List<Object> array)Transform labels to normalized encoding.
-
-
-
Method Detail
-
setClasses
public void setClasses(List<Object> value)
Sets the label for each class. * @param value The new value for classes.
-
transform
public NumpyArray<Long> transform(List<Object> array)
Transform labels to normalized encoding.- Specified by:
transformin classTransformerMixin<List<Object>,NumpyArray<Long>>- Parameters:
array- array-like of shape (n_samples,) Target values.- Returns:
- array-like of shape (n_samples,) Labels as normalized encodings.
-
inverseTransform
public List<Object> inverseTransform(NumpyArray<Long> array)
Takes a transformed array and reveres the transformation.- Specified by:
inverseTransformin classTransformerMixin<List<Object>,NumpyArray<Long>>- Parameters:
array- The array to apply reveres transform.- Returns:
- The inversed transform of array.
-
-