Sub topic 1
Training Score Versus Validation Score
Prerequisites
Assume you know supervised learning, training and test sets, scikit-learn estimators, and the basic idea of overfitting.
Training and validation scores
A training score measures a model on the examples used to fit it. A validation score measures it on separate examples that were not used during that fit. Comparing them reveals how well the model generalizes.
| Pattern | Training score | Validation score | Likely meaning |
|---|---|---|---|
| Both low and close | Low | Low | Underfitting |
| Training high, validation much lower | High | Low | Overfitting |
| Both high and close | High | High | Good fit |
The score gap matters because a model can memorize training examples without learning useful patterns.
Underfitting and overfitting
Underfitting occurs when a model is too simple, too strongly regularized, or insufficiently trained. It performs poorly even on its training data. Increasing model complexity, reducing regularization, adding useful features, or training longer may help.
Overfitting occurs when a model captures noise or accidental details in the training data. It has a high training score but a lower validation score. More training data, a simpler model, stronger regularization, or fewer features may help.
Bias and variance in plain terms
Bias is error from assumptions that are too simple. High bias commonly produces underfitting.
Variance is sensitivity to the particular training sample. High variance commonly produces overfitting: changing the sample changes the fitted model and its score.
Cross-validation and scoring
Cross-validation repeatedly divides data into training and validation folds. Each fold becomes validation data once. The mean validation score estimates performance on new data, while the spread shows sensitivity to the split.
Choose a scoring metric that matches the real goal. Accuracy may be misleading for imbalanced classes. Use precision, recall, F1, ROC AUC, or an error measure such as mean absolute error when those better represent the cost of mistakes.
Exercise
A model scores 0.99 on training data and 0.72 across validation folds. What is the main diagnosis?
Show answer
Overfitting, or high variance. Try more data, stronger regularization, a simpler model, or fewer features.