binarize
Binarizes the input records so that all the values of the input are either 0 or 1.
Syntax
[binarized_data, parameters] = binarize(X, threshold)
Inputs
- X
 - Input data to be binarized.
 - threshold
 - Threshold value above which are changed to 1 and below are changed to 0.
 
Outputs
- binarized_data
 - Binarized input records.
 - parameters
 - Struct containing values required by binarizeTransform function used on test data.
 
Example
Usage of binarize
X = [1 2 3;
     0 -1 2;
     4 5 6];
[binarized_data, parameters] = binarize(X, 1)
      > binarized_data
binarized_data = [Matrix] 3 x 3
0 1 1
0 0 1
1 1 1
> parameters
parameters = struct [
threshold: 1
]
    Comments
Output 'parameters' can be used by binarizetransform function.