-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
MNT Deprecates _estimator_type and replaces by a estimator tag #17806
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
Conversation
Thanks! There was a very similar PR by either @thomasjpfan or @NicolasHug and there were concerns there about how putting estimator tags could be potentially redundant with determination made by mixins (as far as I remember). I'm not saying it's a concern in this PR but it would be useful to find that discussion. |
Thanks for the advice @rth! I have not found the PR that you mention, but I am +1 about the fact that Do you think that should be (or may be) replaced by the determination made with mixins? |
I also cannot find it. Maybe I'm mis-remembering, too many PRs... Anyway, this looks very reasonable to me. |
Please also add |
Do not worry about the mis-remembering. Maybe @thomasjpfan and @NicolasHug could help us to recover (remember) this discussion? |
Sure, I will include the In fact, I still need to fix an issue regarding some estimators with multiple levels of inheritance (e.g., I will commit these changes as soon as possible! |
Maybe you were referring to this? #16622 (comment) I personally don't see how mixins can help when we're dealing with execution-time properties: what about meta-estimators like e.g. |
I was thinking about using |
The |
Is the plan here to get #18143 right before continuing?? |
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.
The following most likely needs to inherit BaseEstimator
for the other test to pass:
scikit-learn/sklearn/metrics/_plot/tests/test_plot_curve_common.py
Lines 56 to 59 in 193670c
class MyClassifier(ClassifierMixin): | |
def fit(self, X, y): | |
self.classes_ = [0, 1] | |
return self |
estimator = self.steps[-1][1] | ||
estimator_tags = estimator._get_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.
Do we have a test for this logic?
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 have not seen this logic in the tests for the pipeline
module.
The remaining tests should pass when #18614 is merged. |
Reference Issues/PRs
Closes #16469.
What does this implement/fix? Explain your changes.
This PR deprecates the
_estimator_type
private attribute, replaced by a newer estimator tag.