8000 Extra plots in partial dependence plots · Issue #27528 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Extra plots in partial dependence plots #27528

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

Open
arvkevi opened this issue Oct 4, 2023 · 3 comments · May be fixed by #27388
Open

Extra plots in partial dependence plots #27528

arvkevi opened this issue Oct 4, 2023 · 3 comments · May be fixed by #27388

Comments

@arvkevi
Copy link
arvkevi commented Oct 4, 2023

Describe the workflow you want to enable

As discussed in #19410, there has been interest in including additional visualizations along with the partial dependence visualizations. Extra plots would aid in the interpretation of partial dependence plots. It would be low overhead for the user to specify "hist" as an argument and have the feature distribution plotted in the same figure as the partial dependence plot. This issue only addresses the suggestion to improve partial dependence plots, not ICE plots.

Describe your proposed solution

#27388 introduces three new parameters to the from_estimator method in the PartialDependenceDisplay class:

  • extra_plots: A string or list of strings specifying what type of extra plot to include in the partial dependence display.
  • extra_plots_kw: A dictionary where the keys should match the plot type specified in extra_plots and the values are kwarg dictionaries for each plot type.
  • y: Only used in one-way partial dependence plots when the extra plot is a scatter plot.

Their defaults are all None, which does not affect the current PDP display behavior.
The following image can be generated by simply adding: extra_plots=["boxplot", "hist"] to the from_estimator call.

image

Describe alternatives you've considered, if relevant

No response

Additional context

No response

@arvkevi arvkevi added Needs Triage Issue requires triage New Feature labels Oct 4, 2023
@glemaitre glemaitre removed the Needs Triage Issue requires triage label Oct 6, 2023
@ogrisel
Copy link
Member
ogrisel commented Oct 6, 2023

I like the histogram option but I am not convinced that that the boxplot is that helpful: in particular, it wouldn't summarize well multimodal marginal distributions. Maybe a half-violinplot would be a better alternative (which is basically a a KDE-smoothed histogram).

@ogrisel
Copy link
Member
ogrisel commented Oct 6, 2023

For the latter suggestion we should first fix #26658 but I am myself running out of bandwidth :)

@arvkevi
Copy link
Author
arvkevi commented Oct 6, 2023

I also prefer the histogram. I'm happy to update the PR to limit the scope to histogram-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Discussion
3 participants
0