standardize
Standardize the dataset so that each column has its mean as 0. It gives equal weight to all features.
Syntax
[scaled_X, parameters] = standardize(X)
Inputs
- X
- Input data to be standardized.
Outputs
- scaled_X
- Standardized input records.
- parameters
- Struct containing mean and standard deviation of all columns.
Example
Usage of standardize
X = [1, -1, 2;
2, 0, 0;
0, 1, -1];
[X_scaled, parameters] = standardize(X);
> X_scaled
X_scaled = [Matrix] 3 x 3
0.00000 -1.22474 1.33631
1.22474 0.00000 -0.26726
-1.22474 1.22474 -1.06904
> parameters
parameters = struct [
mu: [Matrix] 1 x 3
1.00000 0.00000 0.33333
sigma: [Matrix] 1 x 3
0.81650 0.81650 1.24722
]
Comments
Output 'parameters' can be used by standardizetransform function.