Artificial intelligence · University
Overfitting, regularization and data distribution
A model can fit training-specific noise or patterns that do not generalize. Compare training and appropriately held-out performance.
Prerequisites
Training losses, validation and algebra.
Study notes
Overfitting
A model can fit training-specific noise or patterns that do not generalize. Compare training and appropriately held-out performance.
Regularization
Penalties or constraints can prefer simpler parameter solutions. Their effect depends on the model, scaling and chosen strength.
Bias-variance
Model flexibility, sample size and noise influence prediction error. The tradeoff is a framework, not a universal curve guaranteed in all modern settings.
Distribution shift
New data may differ from training data. Validation should reflect the intended use, and monitoring may reveal later drift.
Worked examples
Which pattern often suggests overfitting?
A generalization gap can indicate training-specific fit, though other problems should also be checked.
Very low training error but much worse held-out error
For w=(3,4), calculate squared L2 norm.
3²+4²=25.
25
Check your understanding
If data loss is 2 and λ times squared L2 norm is 0.5, find the penalized objective.
Where should regularization strength normally be selected?
- Through a suitable validation process
- By file extension
- By repeatedly inspecting final test labels
- By training accuracy alone in every case
Why can feature scaling affect an L2 penalty's practical meaning?
Which is an example of distribution shift?
- Deployment inputs differ systematically from training inputs
- Changing only a chart title
- Renaming the same unchanged file
- Keeping exactly the same data assumptions
Answers and marking guidance
Answers and marking notes
- 2.5
Add loss and penalty.
- Through a suitable validation process
Regularization is a hyperparameter choice.
- The same prediction can require differently sized coefficients when units change. A coefficient-size penalty therefore interacts with feature scales.
Credit units and coefficient magnitudes.
- Deployment inputs differ systematically from training inputs
Shift concerns the data-generating setting.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.
AI-assisted preview; independent educational review required. Level labels describe prerequisites, not accreditation or official curriculum alignment.