What is the difference between training error and generalization error in supervised learning?

Updated May 17, 2026

Short answer

Training error measures performance on seen data, while generalization error measures performance on unseen data.

Deep explanation

Training error is computed on the dataset used to fit the model, while generalization error reflects how well the model performs on new, unseen samples. A model with low training error but high generalization error is overfitting. The true goal in supervised learning is minimizing expected generalization error, not just training loss. Techniques like cross-validation, regularization, and early stopping are used to approximate and control generalization error.

Real-world example

A fraud detection model that performs perfectly on historical transactions but fails on new fraud patterns in production.

Common mistakes

  • Optimizing only training metrics and ignoring validation performance.

Follow-up questions

  • Why is generalization error theoretical?
  • How do we estimate generalization error in practice?

More Supervised Learning interview questions

View all →