-
-
Notifications
You must be signed in to change notification settings - Fork 25.2k
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
[MRG] API use drop a sentinel to disable estimators in voting #13780
Conversation
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.
Otherwise lgtm.
When was the None support added? I'd be tempted to merge this for 0.21 and not support None if that was only just added now...
# regression test for | ||
# https://github.com/scikit-learn/scikit-learn/issues/13777 | ||
voter.fit(X, y, sample_weight=np.ones(y.shape)) | ||
voter.set_params(lr=None) |
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.
Or drop?
sklearn/ensemble/voting.py
Outdated
return [w for est, w in zip(self.estimators, | ||
self.weights) if est[1] is not None] | ||
return [w for est, w in zip(self.estimators, self.weights) | ||
if not(est[1] is None or est[1] == 'drop')] |
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.
Use in (None, 'drop')
?
None was introduced in 0.19: #7674 I assume that we have to keep it then. |
@qinhanmin2014 You can have a look a this now. I solved the conflicts. |
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.
Otherwise LGTM
Co-Authored-By: glemaitre <g.lemaitre58@gmail.com>
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.
LGTM
@jnothman Good to have in 0.21? |
closes #13771
For consistency, we should allow
'drop'
to work the same asNone
to disable estimators in Voting estimators.Need to merge #13777 before to have the bug fix regarding the None and the sample weight.