Least squares: ฮฒ minimizes ฮฃ(y โ ลท)ยฒ, solved via the
normal equations (XแตX)ฮฒ = Xแตy.
Ridge (L2): minimizes ฮฃ(y โ ลท)ยฒ + ฮปฮฃฮฒแตขยฒ โ closed form (XแตX + ฮปI)โปยนXแตy โ shrinks all coefficients smoothly.
Lasso (L1): minimizes ฮฃ(y โ ลท)ยฒ + ฮปฮฃ|ฮฒแตข| โ solved by coordinate descent with soft-thresholding, which can drive coefficients to exactly zero (automatic feature selection).
The bottom chart plots training error (blue) and held-out test error (orange) against polynomial degree at the current regularization โ the classic bias-variance U-curve.
Ridge (L2): minimizes ฮฃ(y โ ลท)ยฒ + ฮปฮฃฮฒแตขยฒ โ closed form (XแตX + ฮปI)โปยนXแตy โ shrinks all coefficients smoothly.
Lasso (L1): minimizes ฮฃ(y โ ลท)ยฒ + ฮปฮฃ|ฮฒแตข| โ solved by coordinate descent with soft-thresholding, which can drive coefficients to exactly zero (automatic feature selection).
The bottom chart plots training error (blue) and held-out test error (orange) against polynomial degree at the current regularization โ the classic bias-variance U-curve.