-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Broken estimator_ attribute on some ensemble models #25588
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
Comments
@BenjaminBossan what would you like to return for gradient boosting? Since we use |
I agree that there is not any specific estimator that should be expected for gradient boosting or voting. A solution could be to remove the |
At a first glance, it seems a good solution since this is not shared between ensemble methods. |
This is a side effect of the deprecation of base_estimator. It will be resolved by itself in 1.4 when the deprecation cycle ends. I opened #25668 to fix the error message in the meantime |
Thanks for the update. |
Describe the bug
Several ensemble models raise an error when trying to access the existing
estimator_
attribute.The problem is that this
property
tries to accessself._estimator
, which is set bysklearn.ensemble.BaseEnsemble._validate_estimator
, but that method is not called by all subclasses.scikit-learn/sklearn/ensemble/_base.py
Line 151 in 4c8813e
For
VotingClassifier
andVotingRegressor
, it's understandable IMO, but the error message could be better. For gradient boosting,estimator_
could return something useful.More as a reminder to myself,
_validate_estimator
is being rewritten in #24250 to return the estimator instead of setting it inplace.Steps/Code to Reproduce
Expected Results
No error is printed.
Actual Results
Versions
The text was updated successfully, but these errors were encountered: