Write the optimality (KKT) conditions for the lasso . Using them, what is the smallest at which , and how do you verify that is the solution for , , ?
Supervised learning, Lasso
Level L5 Expert. Length Long. Nature Mat Mathematical.
What's being asked
Subgradient optimality for a convex but non-smooth objective, and its use to read off the entry point and active set.
Key idea
The condition is if , and if . So iff .
Steps
- The objective is convex, so is optimal iff is in the subdifferential: , where if and if . (The subdifferential of at 0 is the interval .)
- Rewrite with the residual : . Active variables have correlation exactly with the residual and inactive variables have correlation at most in absolute value.
- Entry point: at , and the condition becomes for all . So . For and , .
- Verify the example: gives . For : . Good. For : . Good. So both conditions hold and, by convexity, it is the global minimiser.
- Cross-check with soft-thresholding: and .
- Consequence: the active set has at most variables in general, and the path is piecewise linear in , which is what LARS exploits. If the columns are in general position, the lasso solution is unique.
Common mistakes
- Treating as differentiable at 0, or forgetting the interval there.
- Mixing up the convention. With the entry point is ; with (no half) it is .
- Forgetting standardised columns. depends on column scales.
How long your answer should be
One page; 8 minutes.
Last checked on 4 December 2026.
Read this
Previous in Supervised learning: For two classes, how do you derive the asymptotic error of the 3-nearest-neighbour rule as a function of the posterior , and how do you show that it is never worse than the 1-NN rule at every ? What are the errors of both rules when the local Bayes error is ?
Next in Supervised learning: Prove the Gauss–Markov theorem: under with , and of full column rank, the OLS estimator has the smallest covariance matrix among all linear unbiased estimators. Why does this not rule out ridge regression doing better in MSE?