labelbinarizertransform

Binarize labels in one vs all fashion.

Attention: Available only with Activate commercial edition.

Syntax

labels = labelbinarizertransform(parameters,y)

Inputs

parameters
Parameters returned by labelBinarizer method.
Type: struct
y
Labels to be encoded. Cell can be used to encode string labels.
Type: integer
Dimension: ACIS

Outputs

labels
Binarized labels.
Type: integer
Dimension: vector | matrix

Example

Usage of
y = [1, 2, 2, 1];
parameters = labelbinarizer(y);
label_matrix = labelbinarizertransform(parameters, [1, 2, 3, 4]);
> label_matrix
label_matrix = [Matrix] 4 x 2
1 0
0 1
0 0
0 0

Comments

If unknown labels are found during transformation, it is represented by row of zeros.