Label Binarizer

../../../../_images/label_binarizer.svg

Binarize labels in a one-vs-all fashion.

Several regression and binary classification algorithms are available in the scikit. 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

Documentation

Attributes

classes_

Holds the label for each class.

y_type_

Represents the type of the target data as evaluated by type_of_target(). Possible type are ‘continuous’, ‘continuous-multioutput’, ‘binary’, ‘multiclass’, ‘multiclass-multioutput’, ‘multilabel-indicator’, and ‘unknown’.

Definition

Output ports

model model

Model

Configuration

Negative label (neg_label)

Value with which negative labels must be encoded.

Positive label (pos_label)

Value with which positive labels must be encoded.

Transformed array in sparse format (sparse_output)

Will generate sparse matrix if true. Warning: sparse matrices are not handled by all Sympathy nodes and may be silently converted to non-sparse arrays

Implementation

class node_preprocessing.LabelBinarizer[source]