All lessons in Machine Learning Engineering: Reliable Predictive Models

Cross-Validation and Honest Model Selection

Separate hyperparameter selection from performance reporting using nested or reserved evaluation.

35 minutes · Members lesson · preview

What you will learn

  • Design a split or cross-validation scheme that mirrors how a late-delivery model will be used after dispatch.
  • Compute cross-validated means and fold spreads by hand and state what they do and do not estimate.
  • Separate hyperparameter selection from performance reporting using nested cross-validation or a sealed holdout opened once.

The dispatch team at our fictional parcel carrier wants a model that, at the moment a parcel leaves the depot, estimates the probability it will arrive late. Earlier lessons compared candidate models on a single validation split. That is fine for a first look, but the moment you try several settings and keep the one that scores best, the score you kept stops being an honest forecast of behaviour on parcels nobody has seen. This lesson covers how to resample so the split mirrors real use, how to read the spread across folds without over-interpreting it, and how to keep selection and reporting apart with nested cross-validation or a reserved test set.

Choose another lesson