Module rusty_machine::data::transforms::minmax [] [src]

The Min-Max transformer

This module contains the MinMaxScaler transformer.

The MinMaxScaler transformer is used to transform input data so that the minimum and maximum of each column are as specified. This is commonly used to transform the data to have a minimum of 0 and a maximum of 1.

Examples

use rusty_machine::data::transforms::{Transformer, MinMaxScaler};
use rusty_machine::linalg::Matrix;

// Constructs a new `MinMaxScaler` to map minimum to 0 and maximum
// to 1.
let mut transformer = MinMaxScaler::default();

let inputs = Matrix::new(2, 2, vec![-1.0, 2.0, 1.5, 3.0]);

// Transform the inputs to get output data with required minimum
// and maximum.
let transformed = transformer.transform(inputs).unwrap();

Structs

MinMaxScaler

The MinMaxScaler