BIZNIQUE / CALCULUS / 54
See why an L1 penalty can create exact zeros
See why an L1 penalty can create exact zeros
Compare the fitted coefficient with the threshold imposed by a penalty.
BIZNIQUE / CALCULUS / 54
Compare the fitted coefficient with the threshold imposed by a penalty.
THE IDEA
For the scalar objective ½(w−z)² + λ|w|, the minimiser is soft-thresholding. In the demo z = 3. Increasing λ first shrinks the coefficient and eventually sets it exactly to zero.
w* = sign(z) max(|z|−λ, 0)
The simple closed form assumes this scalar quadratic or an equivalent orthogonal setting. Correlated features and general losses require solving a different optimisation problem.
TRY IT YOURSELF
With z = 3 and λ = 4, what is w*?
Zero. The penalty threshold exceeds the magnitude of z.