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

Scaling statistics come from the training rows only, then are reused on validation and test.

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.

How it connects

← Back to the whole map