Tabellab
AI & Data Science Intermediate

Cross-Validation & Hyperparameter Tuning by Hand: Train/Validation/Test Splits, k-Fold Scores, Grid Search, Overfitting Curves & Data Leakage

Choose model settings without fooling yourself. You will split data into train, validation and test sets, assign k folds, score a simple model fold by fold, run a small grid search over settings, read under- and overfitting curves, spot leakage and time-ordering mistakes and report an honest final score, with every cell checked as you go.

8 lessons 8 labs 2.1 h Certificate

One-time payment · lifetime access · lessons, labs, exam and certificate included · no subscription.

About this course

This course shows how to choose model settings without fooling yourself, using a toy bike-rental dataset. You split 20 days into train, validation and test sets with MOD on a shuffle number, deal the pool into plain and stratified folds and build a k-nearest-neighbour prediction for a held-out day. You score every fold with its mean absolute error, average the folds and measure their spread. A grid search over k with standard errors leads to the one-standard-error rule. You read under- and overfitting from training and validation curves, catch three kinds of leakage, check a forecast in time order and score the locked test set once.

Lessons

  1. Three Piles of Data: Train, Validation & Test Splits from a Shuffle NumberLab14 min Pro
  2. k-Fold Cross-Validation: Assigning Folds with MOD and Stratifying by ClassLab15 min Pro
  3. A Toy Model per Fold: k-Nearest-Neighbour Predictions for a Held-Out DayLab15 min Pro
  4. Fold Scores: Mean Absolute Error per Fold, the CV Estimate and Its SpreadLab15 min Pro
  5. Grid Search: A Setting × Fold Table, the Best k and the One-Standard-Error RuleLab16 min Pro
  6. Under- and Overfitting: Training vs Validation Error by Model ComplexityLab15 min Pro
  7. Data Leakage: Scaling Before Splitting, Duplicates Across Folds and Rolling-Origin ChecksLab17 min Pro
  8. The Final Report: Choose by CV, Retrain on All Pool Days and Score the Test Set OnceLab16 min Pro