Expand description
§solow-preprocessing
Feature preprocessing for the Solow statistical stack — scalers, encoders, and feature construction.
Every preprocessor exposes the classical fit / transform /
fit_transform / inverse_transform shape from
preprocessing, so a the reference practitioner can migrate a
pipeline call-for-call. The types are also composable through
solow-cv-style cross-validated scoring
and through the higher-level solow-fit formula surface.
§Modules
scalers—StandardScaler,MinMaxScaler,RobustScaler,MaxAbsScaler,Normalizer. All supportpartial_fit-style incremental statistics update where applicable and deriveSerialize/Deserializeunder the opt-inserdefeature.encoders—LabelEncoder(1-D categoricalusize↔ label),OrdinalEncoder(per-column labels for a matrix), andOneHotEncoderwith an optionaldrop_firstfor regression design-matrix compatibility.polynomial—PolynomialFeatureswithdegree,interaction_only, andinclude_biasmatching the reference semantics exactly.discretize—KBinsDiscretizerwithUniform,Quantile, andKMeansbinning strategies.
Every preprocessor’s transform is deterministic and side-effect-free;
there is no hidden RNG. KBinsDiscretizer::KMeans is the only
stochastic component and takes an explicit seed.
§Example — a full preprocessing chain
use ndarray::array;
use solow_preprocessing::{StandardScaler, PolynomialFeatures};
let x = array![[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]];
// Standardize.
let scaler = StandardScaler::fit(x.view()).unwrap();
let x_std = scaler.transform(x.view()).unwrap();
// Expand to polynomial features up to degree 2 (no bias column).
let poly = PolynomialFeatures::new(2).include_bias(false);
let x_poly = poly.fit_transform(x_std.view()).unwrap();
assert_eq!(x_poly.ncols(), 5); // x0, x1, x0², x0·x1, x1²Re-exports§
pub use binarizer::Binarizer;pub use discretize::BinStrategy;pub use discretize::KBinsDiscretizer;pub use encoders::LabelEncoder;pub use encoders::OneHotEncoder;pub use encoders::OrdinalEncoder;pub use function_transformer::FunctionTransformer;pub use label_binarizer::LabelBinarizer;pub use label_binarizer::MultiLabelBinarizer;pub use polynomial::PolynomialFeatures;pub use power::PowerMethod;pub use power::PowerTransformer;pub use power::QuantileOutput;pub use power::QuantileTransformer;pub use scalers::MaxAbsScaler;pub use scalers::MinMaxScaler;pub use scalers::NormKind;pub use scalers::Normalizer;pub use scalers::RobustScaler;pub use scalers::StandardScaler;pub use spline::SplineTransformer;pub use target_encoder::TargetEncoder;
Modules§
- binarizer
Binarizer— element-wise threshold transformer.- discretize
KBinsDiscretizer— bin each column of a feature matrix into a small integer alphabet.- encoders
- Categorical encoders.
- function_
transformer FunctionTransformer— apply a caller-supplied elementwise (or row-wise) function on transform.- label_
binarizer LabelBinarizerandMultiLabelBinarizer— turn integer / string label vectors into a binary indicator matrix.- polynomial
PolynomialFeatures— expand a feature matrix into all monomials up to a given total degree.- power
- Power transforms —
PowerTransformerwith the Yeo-Johnson (2000) and Box-Cox (1964) families, andQuantileTransformerfor empirical-CDF mapping to a uniform or standard-normal target. - prelude
- Commonly-used imports.
- scalers
- Feature scalers.
- spline
- SplineTransformer — B-spline basis expansion.
- target_
encoder - TargetEncoder — mean-target encoding with a smoothing prior.