Lesson 5.5 · 9 min read · about 50 min to master at a very slow pace
LASSO Regression (L1)
LASSO penalises the sum of absolute coefficients, which shrinks some exactly to zero: built-in variable selection. Soft thresholding, a worked comparison with ridge, and when to prefer each.
LASSO objective
LASSO = Least Absolute Shrinkage and Selection Operator.
- Higher : smaller coefficients, higher bias, lower variance, just like ridge.
- The key difference: LASSO shrinks some coefficients to exactly zero, so it performs variable selection and gives sparse, interpretable models.
- No closed form: it's solved iteratively (e.g. coordinate descent). Harder than ridge, far easier than best subset.
- Like ridge, no convenient significance test for coefficients.
Soft thresholding
In the orthonormal case (), with and the objective written as RSS :
Worked example: ridge vs LASSO on the same OLS coefficients
OLS: , , so the LASSO threshold is .
Ridge: . All non-zero.
LASSO: . The small coefficient becomes exactly 0 (variable dropped); the others shrink by a constant 1.
Ridge or LASSO?
| Situation | Favour |
|---|---|
| Many predictors, you believe only a few matter, you want interpretability | LASSO (sparse) |
| Many correlated predictors that all plausibly contribute a little | Ridge (shares credit, stable) |
| Groups of correlated predictors and you want selection | Elastic net (a mix of both) |
LASSO with correlated predictors
Among highly correlated predictors LASSO tends to pick one and drop the rest, somewhat arbitrarily; which one can change with a small change in the data. Don't read a dropped variable as "irrelevant", and never describe LASSO-selected variables as "the causes".
Cheatsheet
LASSO
Ridge vs LASSO in one line
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.