Class LabelBinarizer


  • public class LabelBinarizer
    extends TransformerMixin<List<Object>,​NumpyArray<Long>>
    Binarize labels in a one-vs-all fashion. Several regression and binary classification algorithms are available in scikit-learn. A simple way to extend these algorithms to the multi-class classification case is to use the so-called one-vs-all scheme. At learning time, this simply consists in learning one regressor or binary classifier per class. In doing so, one needs to convert multi-class labels to binary labels (belong or does not belong to the class). LabelBinarizer makes this process easy with the transform method. At prediction time, one assigns the class for which the corresponding model gave the greatest confidence. LabelBinarizer makes this easy with the inverse_transform method.
    • Constructor Detail

      • LabelBinarizer

        public LabelBinarizer()
        Instantiate a new object of LabelBinarizer.
    • Method Detail

      • setClasses

        public void setClasses​(List<Object> value)
        Sets the Holds the label for each class.
        Parameters:
        value - The new value for classes.
      • getClasses

        public List<Object> getClasses()
        Gets the Holds the label for each class.
      • setYType

        public void setYType​(String value)
        Sets the Represents the type of the target data as evaluated by utils.multiclass.type_of_target. Possible type are 'continuous', 'continuous-multioutput', 'binary', 'multiclass', 'multiclass-multioutput', 'multilabel-indicator', and 'unknown'.
        Parameters:
        value - The new value for yType.
      • getYType

        public String getYType()
        Gets the Represents the type of the target data as evaluated by utils.multiclass.type_of_target. Possible type are 'continuous', 'continuous-multioutput', 'binary', 'multiclass', 'multiclass-multioutput', 'multilabel-indicator', and 'unknown'.
      • setNegativeLabel

        public void setNegativeLabel​(long value)
        Sets the value of NegLabel
        Parameters:
        value - The new value for NegLabel.
      • getNegativeLabel

        public long getNegativeLabel()
        Gets the value of NegLabel
      • setPositiveLabel

        public void setPositiveLabel​(long value)
        Sets the value of PosLabel
        Parameters:
        value - The new value for PosLabel.
      • getPositiveLabel

        public long getPositiveLabel()
        Gets the value of PosLabel