Package smile.feature.transform
package smile.feature.transform
Feature transformations for preprocessing numeric data before model training.
The package provides the following transformers:
| Class | Technique | Scope | Typical Use Case |
|---|---|---|---|
Scaler |
Min–max scaling to [0, 1] | Column-wise | Bounded features; sensitive to outliers |
WinsorScaler |
Percentile-clipped min–max scaling to [0, 1] | Column-wise | Outlier-robust bounded scaling (default 5th–95th percentile) |
MaxAbsScaler |
Divide by maximum absolute value; range [−1, 1] | Column-wise | Preserves sparsity; suitable for sparse data |
Standardizer |
Zero mean, unit variance (z-score) | Column-wise | Gaussian features; distance-based models (KNN, SVM) |
RobustStandardizer |
Subtract median, divide by IQR | Column-wise | Outlier-robust standardization |
Normalizer |
Scale each row to unit L1 / L2 / L∞ norm | Row-wise (stateless) | Text classification, cosine-similarity models |
All column-wise transformers implement
InvertibleColumnTransform and can be composed
into a pipeline via Transform.pipeline(Transform...).
-
ClassDescriptionScales each feature by its maximum absolute value.Normalize samples individually to unit norm.Vector norm.Robustly standardizes numeric feature by subtracting the median and dividing by the IQR.Scales the numeric variables into the range [0, 1].Standardizes numeric feature to 0 mean and unit variance.Scales all numeric variables into the range [0, 1].