Module rusty_machine::data::transforms::standardize
source · [−]Expand description
The Standardizing Transformer
This module contains the Standardizer
transformer.
The Standardizer
transformer is used to transform input data
so that the mean and standard deviation of each column are as
specified. This is commonly used to transform the data to have 0
mean
and a standard deviation of 1
.
Examples
use rusty_machine::data::transforms::{Transformer, TransformFitter, StandardizerFitter};
use rusty_machine::linalg::Matrix;
let inputs = Matrix::new(2, 2, vec![-1.0, 2.0, 1.5, 3.0]);
// Constructs a new `Standardizer` to map to mean 0 and standard
// deviation of 1.
let mut transformer = StandardizerFitter::default().fit(&inputs).unwrap();
// Transform the inputs to get output data with required mean and
// standard deviation.
let transformed = transformer.transform(inputs).unwrap();
Structs
The Standardizer
A builder used to construct a
Standardizer