-
-
Notifications
You must be signed in to change notification settings - Fork 26k
TST introduce _safe_tags for estimator not inheriting from BaseEstimator #18797
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
a68194b
36f1c5c
9e54014
764968d
8f571ac
88b01f1
05d4225
5630266
508d5e0
610d645
7d0a4f6
eeaf7b0
fdf1011
b9b2331
4e1f93b
7b9b6be
45ada6b
a51d75b
9874b7c
007fa09
6839f58
5d73730
5021fbc
ddf6c79
369e7b7
61cdfca
5ba8c0c
41bc206
739d084
04b0018
18368ea
2e08d2a
4aeae95
15410b3
7eaab71
93dc099
d53adca
3b671d8
7130ff6
c9f6af4
642c305
1fd2e57
eb9c41b
8227075
07dace1
f3c2b02
d76b684
e8fa827
ed26968
b8ecc41
bb10791
b19137d
754539f
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 |
---|---|---|
|
@@ -1985,15 +1985,3 @@ def _more_tags(self): | |
"Set the estimator tags of your estimator instead") | ||
with pytest.warns(FutureWarning, match=msg): | ||
cross_validate(svm, linear_kernel, y, cv=2) | ||
|
||
# the _pairwise attribute is present and set to True while the pairwise | ||
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. @NicolasHug by not being permissive (getting default with _get_tags), we need to remove this test. What do you think about this. 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. We are not sure that this case is actually possible in practice. 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. I haven't followed the introduction of the |
||
# tag is not present | ||
class NoEstimatorTagSVM(SVC): | ||
def _get_tags(self): | ||
tags = super()._get_tags() | ||
del tags['pairwise'] | ||
return tags | ||
|
||
svm = NoEstimatorTagSVM(kernel='precomputed') | ||
with pytest.warns(FutureWarning, match=msg): | ||
cross_validate(svm, linear_kernel, y, cv=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Additionnal tags can be created"
I thought we agreed not to support that #18797 (comment)? (or that's how I interpret @ogrisel's +1)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a difference between supporting in
_safe_tags
and people creating their own tags within their libraries using_more_tags
. This is a real need here:https://github.com/rapidsai/cuml/pull/3113/files#diff-e4bd6eee2eca2b0619b03a5f6ba7b471b4ca03080a6619d0079105d5f13c2165R34-R35
We have something similar in imbalanced-learn since the introduction of tags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My +1 was to remove the default param to the
_safe_tags
. I think third-party implementers are free to add other tags in their own estimators if they which. cuML is already doing in in their master branch apparently:https://github.com/rapidsai/cuml/pull/3113/files