5
$\begingroup$

In the language R there is the possibility to estimate the best $\lambda$ for an elastic net model via a cross-validation, having set the value of $\alpha$. However, being $\alpha$ defined as $\lambda_2/(\lambda_1+\lambda_2)$, where $\lambda_1$ and $\lambda_2$ are the coefficients of the penalizations for the ridge and lasso terms, how is $\lambda$ defined?

$\endgroup$

1 Answer 1

15
$\begingroup$

You're confused; $\alpha$ and $\lambda$ are totally different.

$\alpha$ sets the degree of mixing between ridge regression and lasso: when $\alpha = 0$, the elastic net does the former, and when $\alpha = 1$, it does the latter. Values of $\alpha$ between those extremes will give a result that is a blend of the two.

Meanwhile, $\lambda$ is the shrinkage parameter: when $\lambda = 0$, no shrinkage is performed, and as $\lambda$ increases, the coefficients are shrunk ever more strongly. This happens regardless of the value of $\alpha$.

$\endgroup$
2
  • 1
    $\begingroup$ My problem was that in my lecture notes the professor used the notation of $\lambda_1$ and $\lambda_2$ to identify the parameters of the ridge and the lasso regression, and from them he derives the generalization of the elastic net, setting $\alpha$ like in the question. Hence, I thought $\lambda$ of R was related to these parameters! :) $\endgroup$
    – Pippo
    Commented Jul 24, 2013 at 12:24
  • $\begingroup$ For extra confusion: the Python sklearn elasticnet implementation uses alpha as the shrinkage parameter, and the l1_ratio parameter as the ratio between l1 and l2. $\endgroup$ Commented Jul 31, 2023 at 18:20

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.