Ridge Regression
1. Problem It Fixes
OLS explodes when features correlate or ( singular). Ridge adds penalty:
controls shrinkage. Larger → smaller, stabler .
2. Closed Form
makes matrix invertible even when is singular. Bayesian view: Gaussian prior on (MAP).
3. Effect
| Behaviour | |
|---|---|
| OLS (may overfit) | |
| small | stabilizes, tiny bias |
| large | heavy shrinkage, may underfit |
Ridge shrinks but never zeroes — keeps all features. Use cross-validation to pick .
4. Worked Intuition
two almost-identical features → OLS gives +1000, -999 (cancels)
Ridge λ=1 → gives +2.1, +1.9 (stable, small)
5. Exam Points
- Write objective + solution — 5-7 marks, very frequent.
- Why fixes singularity — 3 marks, frequent.
- Ridge vs OLS, role of — 3 marks, frequent.