Lesson 5.6 · 8 min read · about 50 min to master at a very slow pace
Understanding λ (Lambda)
What happens at λ = 0, small, intermediate, large and infinite λ. Why regularisation never beats OLS on training error, and how bias, variance and coefficients move along the way.
The regimes of λ
| λ | Coefficients | Training error | Bias / variance | Typical test error |
|---|---|---|---|---|
| 0 | OLS | Minimum possible | Lowest bias, highest variance | High if overfitting |
| Small | Slightly shrunk | Rises a little | Variance falls | Often falls |
| Intermediate | Moderately shrunk (LASSO: some zero) | Higher | Balanced | Best (chosen by CV) |
| Large | Heavily shrunk | High | High bias | Rises again |
| All slopes → 0 (LASSO: exactly 0 beyond a finite λ) | = TSS (predicts ) | Pure bias | Underfitting |
When is training error lowest?
At . With no penalty, ridge and LASSO both reduce to OLS, which by definition minimises RSS. Training error then increases (weakly) as grows. Regularisation buys better test error with extra bias; it never beats OLS on the training data.
Training loss vs penalised objective
For each λ, the regularised solution minimises RSS + penalty, so it beats OLS on that objective. But OLS beats it on plain RSS. If a question asks about "training error", it means RSS/MSE.
Coefficient paths
OLS coefficients 3 (teal), −1.5 (coral), 0.4 (amber) and 1.2 (violet), orthonormal design.
The order in which LASSO drops variables is a rough ranking of importance: the coefficients that survive longest matter most. In practice is plotted on a log scale.
Interpreting a change in λ
Training MSE is 0.8 at and 1.1 at ; test MSE is 3.0 at and 1.9 at . The unpenalised model overfits: the penalty raised training error slightly but cut test error substantially, by reducing variance.
Across many random training sets, regularised models give more consistent coefficients (less variable), at the price of bias. The net effect on prediction is best at an intermediate λ.
Cheatsheet
λ regimes
Lowest training error?
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.