4.3 LASSO
An L1 penalty that can zero out coordinates.
These notes walk through the lecture slides. The original deck is unchanged; use (slides) on the course hub if you want that PDF.
The figures follow Deisenroth, Faisal, and Ong, Mathematics for Machine Learning, and Theodoridis, Machine Learning: A Bayesian and Optimization Perspective.
1. LASSO
Ridge’s penalty shrinks every coefficient toward zero but never sets one exactly to zero. That is not sparsity.
LASSO (least absolute shrinkage and selection operator) uses an penalty instead:
where is the -norm of .
2. Geometry

The constraint is a diamond. As grows, that diamond has more corners, so some coefficients land on an axis and become zero. LASSO therefore shrinks and does subset selection.
3. The objective
Squared error plus . The term is not differentiable at , so ordinary gradients are not enough.
A subgradient generalizes the gradient. One subgradient of this is
with
Subgradient descent (or a cousin) iterates until settles.
4. Comments
- LASSO does variance reduction, gives accurate predictions, and is built for variable selection.
- A little regularization is usually wise. Ridge is a safe default. Prefer LASSO if you believe only a few features matter.
- If the columns of are orthonormal, LASSO has the closed form
That is soft thresholding: is the positive part (the argument if it is nonnegative, otherwise zero). 4. In the same orthonormal case, ridge is a uniform shrink: .
5. Computational complexity
A closed form exists only in special cases (orthonormal columns). Otherwise use (sub)gradient descent, especially when there are many features or too many rows for memory.
Soft thresholding is one solver. Another is to approximate by a family of smooth quadratics,
6. Practice
-
What does soft thresholding do to a coordinate of the LASSO?
-
Why is the LASSO objective not differentiable at ?
-
When would you prefer LASSO to ridge?