Thanks to visit codestin.com
Credit goes to github.com

Skip to content

The alpha parameter for lasso regression can only be a float #30893

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kxiao1 opened this issue Feb 25, 2025 · 1 comment · Fixed by #30911
Closed

The alpha parameter for lasso regression can only be a float #30893

kxiao1 opened this issue Feb 25, 2025 · 1 comment · Fixed by #30911

Comments

@kxiao1
Copy link

kxiao1 commented Feb 25, 2025

Describe the issue linked to the documentation

https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Lasso.html#sklearn.linear_model.Lasso

The line "If an array is passed, penalties are assumed to be specific to the targets. Hence they must correspond in number." is found under the "Notes" section. However, in the parameters section and the source, alpha is listed as float, default=1.0

Suggest a potential alternative/fix

The line should be deleted. Better yet, allow alpha to be an array, like for https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.Ridge.html.

@kxiao1 kxiao1 added Documentation Needs Triage Issue requires triage labels Feb 25, 2025
@jeremiedbb
Copy link
Member

Thanks for the report @kxiao1. Indeed this line was added by mistake as the result of a too quick copy-paste and should be removed. Would you be interested in making a PR ?

Better yet, allow alpha to be an array

There have been long standing discussions where a consensus was never really reached afaik (see for instance #11566).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants