-
-
Notifications
You must be signed in to change notification settings - Fork 26k
ENH kind accept a list of str in plot_partial_dependence #19438
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
@thomasjpfan @NicolasHug This should make the job I think. |
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 , gave it a quick look
Basically I see the new features of specifying a list as unrelated to the warning / error mechanism. In fact, I feel like this list syntax is the "natural" way of specifying |
This is one of the reason that I have 2 entries in the what's new. I can split the PR into 2. One to support the list as an enhancement and another one as a "bug" fix that introduce the warning. It will not make a huge change in the review process thought. |
I agree a single PR is fine, I was trying to explain my reasoning behind #19438 (comment) :) |
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.
Code looks good. One question about the API
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.
Here is a suggestion regarding introducing validation on kind
.
Co-authored-by: Thomas J. Fan <thomasjpfan@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.
Some feedback. I think several comments and messages need to be adapted to be consistent with the decision to switch from a warning to an exception:
gentle ping to @ogrisel @thomasjpfan |
doc/whats_new/v1.1.rst
Outdated
- |Enhancement| :class:`linear_model.RidgeClassifier` is now supporting | ||
multilabel classification. |
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.
Unrelated whats new entries. Could be related to #21516 ?
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 moved them because they were not in the right section.
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.
Ah I see. Usually we do not do clean whats new clean ups in feature PRs?
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.
OK let me revert it and I will make a push the merging day in main
.
default_pd_lines_kws = { | ||
"color": "tab:orange", | ||
"linestyle": "--", | ||
} |
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.
Instead of deleting ice_lines_kw["label"]
here, I think we can set label
here:
default_pd_lines_kws = { | |
"color": "tab:orange", | |
"linestyle": "--", | |
} | |
default_pd_lines_kws = { | |
"color": "tab:orange", | |
"linestyle": "--", | |
"label": "average" | |
} |
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.
it is not enough because "label"
is part of default_line_kws
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 problem comes if a user provides a "label"
key when calling plot
to overwrite the label. Then we need to delete the key in some cases.
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 forgot to finish the thought. I thought we could leave the label out of default_line_kws
too, since it only applies to default_pd_lines_kws
.
The problem comes if a user provides a "label" key when calling plot to overwrite the label. Then we need to delete the key in some cases.
I think I see what you mean. If line_kw
has a "label", then we want to remove the label for ice plots?
Scrolling up I see this is the same logic we had before, so I am okay with keeping it as is.
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.
Yep exactly
Co-authored-by: Thomas J. Fan <thomasjpfan@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
doc/whats_new/v1.1.rst
Outdated
- |Enhancement| :class:`linear_model.RidgeClassifier` is now supporting | ||
multilabel classification. |
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.
Ah I see. Usually we do not do clean whats new clean ups in feature PRs?
default_pd_lines_kws = { | ||
"color": "tab:orange", | ||
"linestyle": "--", | ||
} |
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 forgot to finish the thought. I thought we could leave the label out of default_line_kws
too, since it only applies to default_pd_lines_kws
.
The problem comes if a user provides a "label" key when calling plot to overwrite the label. Then we need to delete the key in some cases.
I think I see what you mean. If line_kw
has a "label", then we want to remove the label for ice plots?
Scrolling up I see this is the same logic we had before, so I am okay with keeping it as is.
So I am waiting for the CI and I will merge. I will make a subsequent PR to solve the misordering of the changelog |
…n#19438) Co-authored-by: Julien Jerphanion <git@jjerphan.xyz> Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
closes #19305
This PR proposes that:
kind
supports a list of str of the same length asfeatures
to specify different PD plots for each axis.kind="both"
and a 2-way partial dependence is requested in feature, a warning is raised instead of not making any plot. The warning will stipulate to pass a list to silence it.