3
$\begingroup$

The L2 regularization lead to minimize the values in the vector parameter. The L1 regularization lead to setting some coefficients to 0 in the vector parameter.

More generally, I've seen that non-differentiable regularization function lead to setting coefficients to 0 in the parameter vector. Why is that the case?

$\endgroup$
3
  • 4
    $\begingroup$ Does this answer your question? how Lasso regression helps to shrinks the coefficient to zero and why ridge regression dose not shrink the coefficient to zero? $\endgroup$
    – Ben Reiniger
    Commented Jul 27, 2021 at 3:10
  • 1
    $\begingroup$ @BenReiniger There is some additional value here: the generalization of L1 to "non differentiable" regularization. I was well aware of L1 but not the general case. $\endgroup$ Commented May 20, 2023 at 14:07
  • $\begingroup$ @WestCoastProjects fair, but I think the general intuition is the same (e.g. L_alpha "norms" with alpha between 0 and 2)...except when it's false, e.g. using the infinity-norm would put the sharp corners of the constraint region along $x_1=x_2$ and thus encourage non-sparse solutions! $\endgroup$
    – Ben Reiniger
    Commented May 20, 2023 at 14:46

3 Answers 3

0
$\begingroup$

Look at the penalty terms in linear Ridge and Lasso regression:

Ridge (L2):

enter image description here

Lasso (L1):

enter image description here

Note the absolute value (L1 norm) in the Lasso penalty compared to the squared value (L2 norm) in the Ridge penalty.

In Introduction to Statistical Learning (Ch. 6.2.2) it reads: "As with ridge regression, the lasso shrinks the coefficient estimates towards zero. However, in the case of the lasso, the L1 penalty has the effect of forcing some of the coefficient estimates to be exactly equal to zero when the tuning parameter λ is sufficiently large. Hence, much like best subset selection, the lasso performs variable selection."

http://www-bcf.usc.edu/~gareth/ISL/

$\endgroup$
3
  • 2
    $\begingroup$ This, I know already, I'm asking why that is the case, more like a mathematical intuition or proof. $\endgroup$
    – Victor
    Commented Jul 1, 2019 at 9:09
  • 1
    $\begingroup$ I thought you can directly see it from the math: Have a look at this page (Section: Comparing regularization techniques — Intuition). It's all about the norms (L1 vs. L2) blog.alexlenail.me/… $\endgroup$
    – Peter
    Commented Jul 1, 2019 at 11:39
  • $\begingroup$ This is not answering the question about the general case of non-differentiable regularization functions. If that reference answers it then an excerpt would helpfully be included above $\endgroup$ Commented May 20, 2023 at 14:08
0
$\begingroup$

ISLR talks about this topic in details, it can be understood by looking Contours of error and loss function given in the image below:

enter image description here

Each of the ellipses centered around βˆ represents a contour: this means that all of the points on a particular ellipse have the same RSS value. As the ellipses expand away from the least squares coefficient estimates, the RSS increases. Equations (6.8) and (6.9) indicate that the lasso and ridge regression coefficient estimates are given by the first point at which an ellipse contacts the constraint region. Since ridge regression has a circular constraint with no sharp points, this intersection will not generally occur on an axis, and so the ridge regression coefficient estimates will be exclusively non-zero. However, the lasso constraint has corners at each of the axes, and so the ellipse will often intersect the constraint region at an axis. When this occurs, one of the coefficients will equal zero. In higher dimensions, many of the coefficient estimates may equal zero simultaneously

$\endgroup$
0
$\begingroup$

For orthogonal features you can show with sub derivative methods that $\hat\beta_{j}^{\text{Lasso}}=\hat\beta_{j}^{\!\;\text{OLS}} \max \Biggl( 0, 1 - \frac{ N \lambda }{ \bigl|\hat\beta{}_j^{\!\;\text{OLS}}\bigr| } \Biggr)$. Here you see that some regression coefficients are set to exactly 0. People call this the soft thresholding operator. The proof with sub derivatives is needed since the absolute function has no normal derivative.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.