Lesson 6 of 6 8 min · 117 words
Choosing λ
Tuning the penalty strength with cross-validation.
controls the strength of the penalty. : no regularisation, risk of overfitting. Very large : all weights near zero, underfitting. The best value is somewhere in between and depends on the data.
Choose it with cross-validation: try values on a logarithmic grid (), compute the cross-validated error for each, and pick the minimum. Plotting error against gives the U-shaped validation curve.
The one-standard-error rule picks the largest whose error is within one standard error of the best — a simpler model that is statistically just as good.
Formula to remember
Ridge closed form
λI keeps the matrix invertible.
Quick check · +5 XP