binarizetransform

Binarize the test records so that all the values of the input are either 0 or 1.

Syntax

binarized_data = binarizetransform(parameters,X)

Inputs

X
Input data to be binarized.
Type: double
Dimension: matrix
parameters
Struct containing values computed using training data and returned by the binarize function.
Type: double | integer
Dimension: struct

Outputs

binarized_data
Binarized input records.
Type: integer
Dimension: matrix

Example

Usage of binarizetransform

X = [1 2 3;
     0 -1 2;
     4 5 6];
X_test = [0 1 4];
[binarized_data, parameters] = binarize(X, 1);
binarized_test_data = binarizetransform(parameters, X_test);
disp(binarized_data);
disp(binarized_test_data);
[Matrix] 3 x 3
0 1 1
0 0 1
1 1 1
[Matrix] 1 x 3
0 0 1
>