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,
]).expect("valid matrix dimensions");
// Standardize to zero mean and unit variance
let mut scaler = StandardScaler::new();
let scaled = scaler.fit_transform(&data).expect("fit_transform should succeed");
// Each column now has mean ≈ 0 and std ≈ 1
assert!(scaled.get(0, 0).abs() < 2.0);Structs§
- MinMax
Scaler - Scales features to a given range (default [0, 1]).
- PCA
- Principal Component Analysis (PCA) for dimensionality reduction.
- Standard
Scaler - Standardizes features by removing mean and scaling to unit variance.
- TSNE
- t-SNE for dimensionality reduction and visualization.