1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Data preprocessing and dataset splits.
//!
//! The submodules provide label encoding, array normalization, standardization, and train-test splits.
//! Stateful scalers store training statistics for later data batches.
//!
//! # Examples
//!
//! ```rust
//! use rustyml::utils::standardize::{standardize, StandardizationAxis};
//! use rustyml::utils::StandardScaler;
//! use ndarray::array;
//!
//! let x = array![[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];
//!
//! // Stateless normalization: the statistics come from `x` itself
//! let standardized = standardize(&x, StandardizationAxis::Column).unwrap();
//! assert_eq!(standardized.dim(), (3, 2));
//!
//! // Stateful: fit on the training matrix, then scale later batches by those numbers
//! let mut scaler = StandardScaler::new();
//! let x_train_scaled = scaler.fit_transform(&x).unwrap();
//! let x_new_scaled = scaler.transform(&array![[7.0, 8.0]]).unwrap();
//! assert_eq!(x_train_scaled, standardized);
//! assert_eq!(x_new_scaled.dim(), (1, 2));
//! ```
/// Conversion between label formats
/// Normalize data along a specified axis using the given norm order
/// Stateful feature scalers that store their training statistics
/// Standardize data to have mean 0 and variance 1
/// Split datasets into training and test sets
/// The crate-wide estimator traits, re-exported here for convenience. Their canonical
/// home is [`crate::traits`]
pub use crate;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;