labelbinarizer
Binarize labels in one vs all fashion.
Syntax
parameters = labelbinarizer(y)
Inputs
- y
- Labels to be encoded. Cell can be used to encode string labels.
Outputs
- parameters
- Parameters to be used by labelbinarizerTransform function.
Example
Usage of labelbinarizer
y = [1, 2, 2, 1];
parameters = labelbinarizer(y);
> parameters
parameters = struct [
label_to_idx: struct [
1: 0
2: 1
]
labels: [Matrix] 2 x 1
1
2
num_labels: 2
]
Comments
Output 'parameters' can be used by labelbinarizertransform function.