-
-
Notifications
You must be signed in to change notification settings - Fork 26.5k
ENH Add kwargs to format ICE and PD lines separately in partial dependence plots #19428
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
|
Please add an entry to the change log at We would also need some test to check the behaviour. These tests are located in What would be important is to check that if the new keywords are used, they takeover the previous available keyword. |
glemaitre
left a 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.
Let's also use the keyword in the documentation: https://scikit-learn.org/stable/auto_examples/inspection/plot_partial_dependence.html#sphx-glr-auto-examples-inspection-plot-partial-dependence-py to highlight the average line in a different color than blue.
Co-authored-by: Guillaume Lemaitre <[email protected]>
Co-authored-by: Guillaume Lemaitre <[email protected]>
|
Hi @mhham thanks for your work so far! Do you mind synchronizing with upstream? Thanks! |
cmarmo
left a 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.
|
I will review this PR shortly |
glemaitre
left a 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.
I am finally back on the PDP feature. I merge the master changes into this PR. I made a couple of comments with a bit of cosmetic for the rendering but the core code looks fine.
glemaitre
left a 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.
LGTM
jjerphan
left a 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.
Thanks for this contribution @mhham!
I have a suggestion to prevent irrelevant warnings to be raised.
thomasjpfan
left a 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.
Thank you for the PR @mhham !
|
Thank you all for the subsequent work 👍 ! |
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!
Thanks @mhham; this helps better interpreting partial dependencies plots. 👍
thomasjpfan
left a 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.
Minor comments on the docstrings, otherwise LGTM.
Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]>
| ax = Axes3D(fig) | ||
| surf = ax.plot_surface(XX, YY, Z, rstride=1, cstride=1, | ||
| cmap=plt.cm.BuPu, edgecolor='k') | ||
| ax = Axes3D(fig, auto_add_to_figure=False) |
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.
AttributeError: Unknown property auto_add_to_figure
So it does not seem to be supported in all matplotlib version?
…dence plots (scikit-learn#19428) Co-authored-by: Guillaume Lemaitre <[email protected]> Co-authored-by: Chiara Marmo <[email protected]> Co-authored-by: Julien Jerphanion <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]>
This PR implements the feature specified in #18976 :
Add two keyword arguments to
sklearn/inspection/_plot/partial_dependence.py:plot_partial_dependence:ice_lines_kwandpd_line_kw. They take priority overline_kwwhen notNoneand allow to format the ICE (individual) lines and the PD (average) line separatelyExample:
Which outputs:
