-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[WIP] Add a supports_sample_weight tag #13565
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
[WIP] Add a supports_sample_weight tag #13565
Conversation
I would have though there are more estimators which support |
From this snippet I tried I observed the reverse: from sklearn.utils.testing import all_estimators
from sklearn.utils.validation import has_fit_parameter
has_sw = 0
tot = 0
for _, Est in all_estimators():
if hasattr(Est, 'fit'):
if has_fit_parameter(Est, 'sample_weight'):
has_sw += 1
tot += 1
print(tot)
print(has_sw)
Also it makes sense to me to play it safe and let the default be false |
I'm holding off on this for a bit. There are many complications to using estimator tags inside the code of the estimators (for now all is fine since they're only used in the estimator checks, but not anymore in this PR). A few issues:
Of course it should still be possible to introduce the tag and only use it in the estimator checks. EDIT: point 1 and 2 have been resolved now and child classes can override parents tags |
Reference Issues/PRs
What does this implement/fix? Explain your changes.
Any other comments?