Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Pipelines & hyperparameter search

solow-pipeline covers sequential and parallel composition of transformers and estimators, column-selective transforms, transformed-target wrappers, full-grid and randomized search, and successive-halving variants for cheap-then-expensive search.

Composition

TypeWhat it does
PipelineSequential composition of transformers followed by a final estimator. Boxed closures for full flexibility.
FeatureUnionParallel-concat of multiple transformer outputs (feature-wise horizontal concatenation).
ColumnTransformerApply different transformers to different column subsets in one fit.
TransformedTargetRegressorWrap a regressor with a target transform and inverse transform (e.g. log-target regression).
SearcherWhat it does
GridSearchCVFull-factorial grid search over hyperparameter combinations on any splitter.
RandomizedSearchCVDeterministic MMIX-LCG-driven random sampling over caller-supplied per-parameter closures.
HalvingGridSearchCVSuccessive-halving over a grid: cheap early filter, expensive final rounds.
HalvingRandomSearchCVSuccessive-halving with randomized sampling.

All searchers return a SearchResult with mean and unbiased standard deviation of the per-fold scores.

Example

#![allow(unused)]
fn main() {
use solow_pipeline::{Pipeline, GridSearchCV, ParamGrid};
use solow_preprocessing::StandardScaler;
use solow_discrete::LogisticRegressionCV;
use solow_cv::StratifiedKFold;

let pipe = Pipeline::new()
    .step("scale", Box::new(StandardScaler::new()))
    .step("clf",   Box::new(LogisticRegressionCV::new()));

let grid = ParamGrid::new().add("clf__C", vec![0.01, 0.1, 1.0, 10.0]);
let cv = StratifiedKFold::new(5)?;
let search = GridSearchCV::new(pipe, grid, cv).fit(&x, &y)?;
Ok::<_, solow_core::Error>(())
}