Map 1 · Supervised learning · Step 2
Get, split and prepare the data
How do I keep part of the data honest for the final check?
Key formula
Fact or figure
The test set is used once. Every extra look turns it into a validation set and makes the reported score optimistic.
Skip this step and…
Standardise or select features before splitting and the held-out rows leak into training: cross-validation can report 0.93 for a model that does much worse on genuinely new customers.
Telco example
6,000 customers to train, 2,000 to validate, 2,000 locked away for the final test. Split by customer, so one person never sits on both sides, and by date if you predict the future.
Learn it
Taught in Section 2 (Statistical Learning and Model Evaluation) of the course. The map follows the machine learning workflow, the order you build a model in; the course teaches in the order that is easiest to learn, so the numbers can jump.
- 2.6 Training, Validation and Test SetsWhat each data split is for, typical split sizes, and why repeatedly checking the test set and picking the best model quietly ruins your performance estimate.
- 2.8 Data Leakage and Good ML PracticesThe six common ways information leaks into model evaluation: test-set reuse, preprocessing before splitting, feature selection before CV, related records across splits, time leakage and target leakage. Each with a scenario, why it is wrong and the fix.