AI/ML Foundations

Overfitting & Generalization

Overfitting happens when a model learns training-set quirks instead of reusable signal. Generalization is the real target: good behavior on future examples drawn from the problem.
  • Training performance alone is not evidence of usefulness
  • The train/validation gap is the classic signal
  • Underfitting is the opposite failure
  • Regularization limits effective capacity
  • More representative data is often the cleanest fix
Learning curve diagnosis
Train performanceValidation performanceLikely diagnosisWhat to try
BadBadUnderfittingBetter features, larger model, train longer
GoodBadOverfittingRegularize, add data, simplify
GoodGoodPromisingTest once, then monitor production
UnstableUnstableData/split/optimization issueCheck labels, leakage, learning rate
Sources
  • Machine Learning Crash CourseDatasets, Generalization, and Overfitting
  • An Introduction to Statistical Learning with PythonStatistical Learning
  • Deep LearningRegularization for Deep Learning