Back to ML Foundations: The Mental Model

Train/Validation/Test — The Three-Split Discipline

The single piece of ML discipline that separates honest models from theatre. FIND_VIDEO: search 'train validation test split machine learning' — recommended channel: StatQuest / Andrew Ng. Aim for 10 min or under.

4 minutesVideo LessonPDF notes
🎯 Free Guest Mode: You are learning for free. Sign in to save your completion progress and quiz answers.

Ready to continue?

Mark this lesson as complete when you're ready to proceed.

Key moments

  1. Model Prediction GoalThe goal is to build a model that predicts car prices based on historical features like make, age, and mileage.
  2. Train/Test Data SplitThe data must be split, typically 80% for training the model and 20% set aside for testing.
  3. Need for Unseen DataTesting on unseen data is necessary to ensure the model generalizes predictions rather than just memorizing the training set.
  4. Testing ProcedureThe model predicts values for the test set features without being shown the actual historical prices.
  5. Evaluation and ComparisonPredicted values are compared against the known actual values in the test set to evaluate performance on unseen data.
  6. Model ApprovalIf the model performs well on the unseen test data, it is approved because it demonstrates good generalization.
PDF notes

Frequently asked questions

Why is the 80/20 split ratio used?

It is a common rule of thumb, but the exact percentage depends on the model type, data size, and specific needs. The key is ensuring the test set is large enough to be representative.

What does it mean if the model performs well on training data but poorly on test data?

This indicates the model has overfit; it learned the specific patterns of the training set but cannot generalize well to new, unseen data.

If the model performs poorly on the test set, what should I do?

You should adjust the model, change the approach, or tweak the hyperparameters. You must then re-evaluate the new model using a fresh, unseen test set.