-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
FIX Check and correct the input_tags.sparse flag #30187
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
Changes from all commits
a896f2e
b0e605d
6c72527
22b5a6b
c306593
6aadc95
7979fa9
6d7c2b1
f73913f
7005797
6962aa9
2668fea
705c414
5178539
e5a4458
64ddb62
d6f277f
0bcc765
d862de7
21ec585
8447756
c653834
d9f4de3
a9fb7d7
e85f94a
8f2f3db
3ac38e1
42d815e
425b473
17ccb72
8429e8f
87e5211
97d700d
66c3bd9
b54a408
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- The `tags.input_tags.sparse` flag was corrected for a majority of estimators. | ||
By :user:`Antoine Baker <antoinebaker>` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- :func:`utils.estimator_checks.check_estimator_sparse_tag` ensures that | ||
the estimator tag `input_tags.sparse` is consistent with its `fit` | ||
method (accepting sparse input `X` or raising the appropriate error). | ||
By :user:`Antoine Baker <antoinebaker>` |
F41A
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -687,6 +687,11 @@ def rmatvec(b): | |
self._set_intercept(X_offset, y_offset, X_scale) | ||
return self | ||
|
||
def __sklearn_tags__(self): | ||
antoinebaker marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tags = super().__sklearn_tags__() | ||
tags.input_tags.sparse = not self.positive | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My team changed to scikit-learn v1.6.1 this week. We had v1.5.1 before. Our code crashes in this exact line with the error "Unexpected <class 'AttributeError'>. 'LinearRegression' object has no attribute 'positive'". We cannot deploy in production because of this. I am desperate enough to come here to ask for help. I do not understand why it would complain that the attribute does not exist given that we were using v1.5.1 before and the attribute has existed for 4 years now. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ItsIronOxide feel free to open a new issue with a reproducer, and ping me. Happy to have a look and help out. |
||
return tags | ||
|
||
|
||
def _check_precomputed_gram_matrix( | ||
X, precompute, X_offset, X_scale, rtol=None, atol=1e-5 | ||
|
Uh oh!
There was an error while loading. Please reload this page.