Train models and generalize to new data
Fit a model, recognize overfitting, and use validation data for model choices.
- Describe training, validation, overfitting, and generalization.
Training adjusts model parameters to reduce an objective on training examples. A model generalizes when it performs well on new examples from the task’s target setting. Overfitting occurs when a model learns patterns specific to its training data and performs worse on unseen cases. Use training data to fit, validation data to compare choices, and a held-out test set for a final, less-biased estimate.
A small example
1training_score = 0.98
2validation_score = 0.71
3if training_score - validation_score > 0.15:
4 print("Inspect for overfitting")Inspect for overfitting
More model complexity is not always better. Regularization, more representative data, and simpler models can help. Repeatedly tuning choices against the test set leaks information about that set into the development process; preserve it for a final evaluation where practical.
Key takeaways
Describe training, validation, overfitting, and generalization.
Evaluate on relevant unseen data and monitor the system after deployment.
Lesson quiz
5 questions · pass with 4 correct · up to 50 XP
Passing this quiz completes the lesson and keeps your streak going. Questions you miss come back in review sessions later.
Questions about this lesson
Stuck? Ask. Figured something out? Share it. Explaining is one of the best ways to learn.
Loading posts…