Package ai.sklearn4j.preprocessing.label
Class MultiLabelBinarizer
- java.lang.Object
-
- ai.sklearn4j.base.TransformerMixin<List<Set<Object>>,NumpyArray<Long>>
-
- ai.sklearn4j.preprocessing.label.MultiLabelBinarizer
-
public class MultiLabelBinarizer extends TransformerMixin<List<Set<Object>>,NumpyArray<Long>>
Transform between iterable of iterables and a multilabel format. Although a list of sets or tuples is a very intuitive format for multilabel data, it is unwieldy to process. This transformer converts between this intuitive format and the supported multilabel format: a (samples x classes)
-
-
Constructor Summary
Constructors Constructor Description MultiLabelBinarizer()Instantiate a new object of MultiLabelBinarizer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>getCachedDict()Gets the value of CachedDictList<Object>getClasses()Gets the A copy of the `classes` parameter when provided.List<Set<Object>>inverseTransform(NumpyArray<Long> array)Takes a transformed array and reveres the transformation.voidsetCachedDict(Map<String,Object> value)Sets the value of CachedDictvoidsetClasses(List<Object> value)Sets the A copy of the `classes` parameter when provided.NumpyArray<Long>transform(List<Set<Object>> array)Takes the input array and transforms it.
-
-
-
Method Detail
-
setClasses
public void setClasses(List<Object> value)
Sets the A copy of the `classes` parameter when provided. Otherwise it corresponds to the sorted set of classes found when fitting.- Parameters:
value- The new value for classes.
-
getClasses
public List<Object> getClasses()
Gets the A copy of the `classes` parameter when provided. Otherwise it corresponds to the sorted set of classes found when fitting.
-
setCachedDict
public void setCachedDict(Map<String,Object> value)
Sets the value of CachedDict- Parameters:
value- The new value for CachedDict.
-
transform
public NumpyArray<Long> transform(List<Set<Object>> array)
Takes the input array and transforms it.- Specified by:
transformin classTransformerMixin<List<Set<Object>>,NumpyArray<Long>>- Parameters:
array- The array to transform.- Returns:
- The transformed array.
-
inverseTransform
public List<Set<Object>> inverseTransform(NumpyArray<Long> array)
Takes a transformed array and reveres the transformation.- Specified by:
inverseTransformin classTransformerMixin<List<Set<Object>>,NumpyArray<Long>>- Parameters:
array- The array to apply reveres transform.- Returns:
- The inversed transform of array.
-
-