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] Fix FutureWarning in plot_partial_dependence_visualization_api.py #16256
[MRG] Fix FutureWarning in plot_partial_dependence_visualization_api.py #16256
Conversation
… well as small linting issue
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, just a small suggestion on making the inline comment more explicit:
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 a lot @ksslng !
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.
Maybe we can just check for isclassifier()
first? LGTM anyway
@NicolasHug thank you for the hint. I hope it's good now! |
Thanks @ksslng! |
Reference Issues/PRs
This PR fixes a Warning in of the examples of #14117.
Specifically
examples/plot_partial_dependence_visualization_api.py (FutureWarning)
.What does this implement/fix? Explain your changes.
Attribute classes_ in DecisionTreeRegressor has been moved to super class BaseDecisionTree and is deprecated. With version 0.24 it will be removed. With an isintance check a hasattr call is prevented and solves the warning, which can be removed in version 0.24.
Any other comments?
Removed also
from ..tree._tree import DTYPE
as it's unused and causes a linting complain.