Skip to main content

Module transform

Module transform 

Source
Expand description

Core transformers — all dependency-free and always available.

Scaling (StandardScaler, MinMaxScaler), imputation (SimpleImputer), encoding (OneHotEncoder), outlier clipping (Winsorize), de-skewing (PowerTransform), and per-subset composition (ColumnTransformer) all implement the Transformer trait. The supervised TargetEncoder needs the target, so it fits on a Dataset rather than a bare frame. (SMOTE-style resampling lives in the balance module behind the preprocessing feature.)

Structs§

ColumnTransformer
Apply different transformers to different column subsets, in the scikit-learn ColumnTransformer style. Columns not named by any group pass through unchanged (unless ColumnTransformer::drop_remainder is set).
MinMaxScaler
Scale each column into [0, 1]: (x - min) / (max - min).
OneHotEncoder
One-hot encode integer-coded categorical columns.
PowerTransform
Yeo-Johnson power transform: spread out a skewed, heavy-tailed column toward normality. A per-column λ is chosen from a grid to minimize skew; the transform is defined for negative values too (unlike Box-Cox). Missing values pass through.
SimpleImputer
Replace missing values (NaN) with a per-column statistic.
StandardScaler
Standardize columns to zero mean and unit variance: (x - mean) / std.
TargetEncoder
Supervised target (mean) encoding for categorical columns: replace each category with the smoothed mean of the target over its rows. Because it needs the target, it fits on a Dataset and is applied before (or outside) the unsupervised pipeline — not a plain Transformer. Categories are the integral values of the selected columns (as produced by Table label-encoding).
Winsorize
Clip each column to a learned [lower, upper] quantile band — the robust answer to heavy tails and outliers. Missing values pass through.

Enums§

ImputeStrategy
The fill strategy for SimpleImputer.