-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST enable to run common test on stacking and voting estimators #18045
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
TST enable to run common test on stacking and voting estimators #18045
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.
I wonder if this was too strict an assumption, although I suppose there's no case that would have previously worked that now would break?
@@ -335,10 +337,24 @@ def _construct_instance(Estimator): | |||
estimator = Estimator(Ridge()) | |||
else: | |||
estimator = Estimator(LinearDiscriminantAnalysis()) | |||
elif required_parameters in (['estimators'],): | |||
# Heterogeneous ensemble classes (i.e. stacking, voting) | |||
if issubclass(Estimator, RegressorMixin): |
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.
except that just because the meta is a regressor, it doesn't mean it consists of regressors...
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.
I would say that it could be a reasonably default for the moment (we can add a meaningful comment).
Right now we are not testing every combination in common tests even for other estimators so it might be a start?
We need to remove the |
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
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 for me as well. We can merge unless @jnothman has other comments/concerns.
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.
I think this is a bit safer than for the *SearchCV changes... but I still believe that it may be unhelpful to putting this special-casing of instance construction into a public module, when you really want to special-case the handling within scikit-learn.
This change is done in a in a private function though, that,
I don't have strong feelings about this (aside for the fact that we should get rid of check_estimator in tests in favor of parametrized common tests). I guess that could also be done with a separate test function(s) as previously done, but might still need some mechanism for check_parameters_default_constructible? Also I would really like to merge #18054 though. Do you understand why that test fails there but not after this PR? |
It seems that |
My bad, we don't need this PR for #18054, I did a silly typo but I am still thinking that this PR is relevant. |
I'd re-merge master before merging into master :) |
…rogeneous_meta_estimator
@adrinjalali done and it's green... shall be merged? Thanks! :) |
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.
Thanks @glemaitre , and thanks @cmarmo for the reminder :)
…it-learn#18045) * TST enable to run common test on stacking and voting estimators * revert config changes * revert unecessary change in _testing * TST remove check_estimator from local files * PEP8
…it-learn#18045) * TST enable to run common test on stacking and voting estimators * revert config changes * revert unecessary change in _testing * TST remove check_estimator from local files * PEP8
This PRs introduce a way to construct Stacking and Voting estimators to run the common test on them.