-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Lasso error when precompute='auto' #19283
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
Comments
I can reproduce. This bug does not exist for the other models supporting import numpy as np
from sklearn.linear_model import (
Lasso,
LassoCV,
ElasticNetCV,
)
models = [
Lasso,
LassoCV,
ElasticNetCV,
]
if __name__ == "__main__":
X = np.random.rand(10, 2)
y = np.random.rand(10)
for Model in models:
try:
model = Model(precompute='auto')
model.fit(X, y)
print("✅", Model)
except Exception as e:
print("❌", Model)
print(type(e), ":", e)
print()
|
It's also mentioned that the |
One could use a private method to specify the check on |
Thanks for the pointers. #3249 might be of relevance.
Yes, alternatively there was another proposition like the one proposed by @agramfort in #14591 to set in the case of precompute = n_samples > K * n_features where @amueller, @agramfort: since you've worked on similar topics (#11014, #14591), what would you suggestions be regarding supporting for |
AFAIK the precompute 'auto' in Lasso was removed as it was not clear when to toggle True or False. We decided to let the user decide and use True by default as it's the best default. I would not put it back unless there is a thorough benchmark (but I think it's hard). |
Thanks for the details. It looks like I would just remove the mentions of |
Describe the bug
The docs state that the
precompute
parameter can be "‘auto’, bool or array-like of shape (n_features, n_features)
." However, attempting to useprecompute='auto'
leads to aValueError
.Steps/Code to Reproduce
Expected Results
No error, should "just work."
Actual Results
Versions
Output from
sklearn.show_versions()
:The text was updated successfully, but these errors were encountered: