Tune hyperparameters without overfitting your test set
8 steps · about 4 h 25 min · Intermediate
- Evaluation and hyperparameter tuning — Scikit-learn course (tutorial, Inria scikit-learn MOOC, 25 min)
It shows the inner and outer loop pattern with scikit-learn's own course code, so you see the mechanics early.
- Nested cross-validation — Scikit-learn course (tutorial, Inria scikit-learn MOOC, 25 min)
It runs the naive and nested versions side by side, so you can see the naive score come out higher.
- 11.5 Nested CV for Algorithm Selection (L11 Model Eval. Part 4) (video, Sebastian Raschka (YouTube), 15 min)
A lecture that explains the nested loops visually and ties them to algorithm selection.
- 11.6 Nested CV for Algorithm Selection Code Example (L11 Model Eval. Part 4) (video, Sebastian Raschka (YouTube), 15 min)
It follows the concept video with a worked code example you can reproduce.
- Nested Cross-Validation for Machine Learning with Python (article, MachineLearningMastery.com, 25 min)
It covers GridSearchCV inside cross_val_score and counts the cost of the extra model fits, so you can plan your compute.
- scikit-learn Part 3 — Cross-Validation & Hyperparameter Tuning (tutorial, KloudVin, 30 min)
It puts the pieces into one workflow: leakage-safe pipelines, a search, nested scoring, and one final score on a sealed test set.
- Model Evaluation, Model Selection, and Algorithm Selection in Machine Learning (article, Sebastian Raschka (arXiv), 1 h 30 min)
It gives the deeper theory behind holdout, k-fold and nested CV, so you know when to use each.
- Nested cross-validation when selecting classifiers is overzealous for most practical applications (article, Wainer and Cawley (arXiv), 40 min)
It ends with the counterpoint: when plain CV is good enough for choosing a model and when nesting is worth its cost.