Tutorvo

Under- and Overfitting: Training vs Validation Error by Model Complexity

Lesson 6 of 815 minLab

This lesson is part of the course

In this lesson

You compare training and validation error for trees of depth 1 to 8, compute the gap, label every depth as underfitting, good fit or overfitting, find the sweet spot and draw both curves in one line chart.

Buy the course once for $9.99 to unlock every lesson and lab, the final exam and the certificate – lifetime access, no subscription.

Lessons in this course

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