question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

LASSO docs. Default value of l1_ratio is 1. Documentation says its 0.5

See original GitHub issue

https://github.com/scikit-learn/scikit-learn/blob/95119c13af77c76e150b753485c662b7c52a41a2/sklearn/linear_model/_coordinate_descent.py#L358

On this webpage: https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html in “Parameters” section, there’s text: “l1_ratio : float, default=0.5”

But default for class sklearn.linear_model.Lasso is l1_ratio = 1.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jeremiedbbcommented, Feb 5, 2021

@parthe your first link points to ElasticNet, but your second link points to Lasso.

Lasso has no l1_ratio parameter. The regularization is controlled by alpha (with a default value of 1.0). The regularization in ElasticNet is controlled by alpha and l1_ratio and the default value of l1_ratio is 0.5.

I think the docs are correct

0reactions
agramfortcommented, Feb 6, 2021

well indeed I see “l1_ratio: float, default=0.5” in the docstring of the path method

but this is due to the fact that the path method is shared with ElasticNet.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sklearn.linear_model.ElasticNet
l1_ratiofloat, default=0.5. Number between 0 and 1 passed to elastic net (scaling between l1 and l2 penalties). l1_ratio=1 corresponds to the Lasso. epsfloat,...
Read more >
Scikit Learn - Elastic-Net - Tutorialspoint
Alpha, the constant that multiplies the L1/L2 term, is the tuning parameter that decides how much we want to penalize the model. The...
Read more >
Generalized Linear Model (GLM) - H2O.ai Documentation
alpha: Specify the regularization distribution between L1 and L2. The default value of alpha is 0 when SOLVER = 'L-BFGS'; otherwise it is...
Read more >
Ridge and Lasso Regression: L1 and L2 Regularization
The default value of regularization parameter in Lasso regression (given by α) is 1. With this, out of 30 features in cancer data-set,...
Read more >
Algorithms in the Machine Learning Toolkit
For example, if threshold=0.01 , then 1% of the fitted density function will be set as the outlier area. The threshold parameter default...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found