Module preprocessing

Module preprocessing 

Source
Expand description

Preprocessing transformers for data standardization and normalization.

This module provides transformers that preprocess data before training.

§Example

use aprender::prelude::*;
use aprender::preprocessing::StandardScaler;

// Create data with different scales
let data = Matrix::from_vec(4, 2, vec![
    1.0, 100.0,
    2.0, 200.0,
    3.0, 300.0,
    4.0, 400.0,
]).unwrap();

// Standardize to zero mean and unit variance
let mut scaler = StandardScaler::new();
let scaled = scaler.fit_transform(&data).unwrap();

// Each column now has mean ≈ 0 and std ≈ 1
assert!(scaled.get(0, 0).abs() < 2.0);

Structs§

MinMaxScaler
Scales features to a given range (default [0, 1]).
StandardScaler
Standardizes features by removing mean and scaling to unit variance.