# Elastic net regression in orange

The penalty term for Elastic regression is written as

How are the values of lambda's calculated if the slider is moved from the right to the left. I have read most the material available on the internet on Elastic Net Regression. Here they define, $\alpha=\lambda_2/(\lambda_1 + \lambda_2)$. If the value of $\lambda_2$ and $\alpha$ is given, then $\lambda_1$ is calculated. In Orange the slider is provided.

$$\lambda_1 = 1 - \lambda_2$$
• The slider on this screenshot shows as 0.50 : 0.50, 50:50, half-half, $.5$. Orange uses scikit-learn underneath, and in sklearn's ElasticNet implementation, l1_ratio is a parameter on $[0, 1]$. – K3---rnc Aug 18 '18 at 18:16
Finally I found the answer. In elastic net the cost function is written as $J(\theta)=MSE + r\alpha\sum_{i=1}^n \vert\theta_i \vert + \frac {1-r}{2}\alpha\sum_{1=1}^n \theta_i ^2$. Here r is the ratio, $\alpha$ is the hyperparameter and n is the number of features. The ratio slider controls r and $\alpha$ slider controls the value of hyperparameter. If the ratio r=0, then Elastic net regression is equal to ridge regression. For r=1, the Elastic Net Regression is equal to Lasso regression. I hope this perfectly answers the question I posed. I would like to have comments from followers of this post.