Regularization
Training techniques that reduce overfitting and help a model generalize better.
Why accept a slightly worse training fit?
A toy fitting rule adds the training error to 0.1 times the sum of squared coefficients. Two candidate models use features on the same scale. The report below gives their training errors and coefficient penalties separately.
| Candidate | Training error | Sum of squares | Total objective |
|---|---|---|---|
| A | 2.0 | 9 | 2.9 |
| B | 2.2 | 1 | 2.3 |
Which candidate does the objective favor?
Candidate B has a slightly larger training error but the smaller total, 2.2 + 0.1 × 1. The regularizer changes the criterion used in fitting. It encodes a preference for smaller coefficients in this example. Other regularizers express other preferences.

When does the preference help?
Check prediction error on held-out observations across several penalty strengths. A strong penalty can suppress real structure, while a weak one can leave the fit sensitive to noise. Scaling the inputs changes coefficient magnitudes, so record preprocessing alongside the chosen strength.
Follow the idea
Overfitting · Recognize fits that do poorly on new examples.
Validation Set · Compare candidate penalty strengths on development data.
Source · Scikit-learn on ridge regression and its penalty
Return to Regularization in the A–Z glossary