Expand description
Model selection: k-fold and stratified cross-validation, and grid search over hyperparameters.
See the book entry Cross-validation and grid search.
Structs§
- Grid
Search Result - The outcome of a grid search.
Functions§
- cross_
validate_ classifier - Scores a classifier on each split (see
cross_validate_regressor). - cross_
validate_ regressor - Scores a regressor on each split:
makebuilds a fresh model, which is fitted on the training rows and scored on the test rows byscore(truth, predicted). - grid_
search - Evaluates every candidate (typically by the mean of a cross-validation) and keeps the best,
by largest score with
greater_is_betteror smallest otherwise. Candidates whose evaluation fails or returns NaN are skipped. - k_fold
foldstrain/test splits of0..samples: every sample is tested exactly once, and fold sizes differ by at most one. With a seed the samples are shuffled first.- mean_
score - The mean of a slice of scores.
- parameter_
grid - Every combination of the values on each axis (the Cartesian product), first axis slowest.
- stratified_
k_ fold - Stratified k-fold: each class is dealt round-robin across the folds (after a seeded shuffle within the class), so every fold has nearly the overall class proportions.
Type Aliases§
- Split
- A train/test split as index lists.