Tune hyperparameters without overfitting your test set

8 steps · about 4 h 25 min · Intermediate

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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.