Module 1 · Learning from data · Lesson 2
Train, validation, test and leakage
Why a model needs three sets with three different jobs, how random, stratified and time-based splits differ, and the ways information leaks from test into train, measured on the ticket data by committing each leak on purpose.
By the end of this lesson you can
- Explain the separate jobs of the training, validation and test sets, and why tuning on the test set destroys its meaning
- Implement random, stratified and time-based splits and choose the right one for data that arrives over time
- Find three leakage mechanisms in a pipeline (a post-resolution feature, preprocessing fitted on all data, duplicates across splits) and fix them with a time split and a scikit-learn Pipeline
- Explain why a fine-tuning run needs its own validation split and why contaminated evaluation sets inflate language-model benchmark scores
