Skip to content
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

Fix plot_pd function to work with matplotlib 3.8.0 changes #965

Merged

Conversation

jklaise
Copy link
Contributor

@jklaise jklaise commented Sep 18, 2023

Closes #964.

Have checked that the output plots on the pdp_regression_bike.ipynb notebook are the same.

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Merging #965 (1786df7) into master (54d0c95) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #965   +/-   ##
=======================================
  Coverage   85.23%   85.23%           
=======================================
  Files          74       74           
  Lines        8832     8834    +2     
=======================================
+ Hits         7528     7530    +2     
  Misses       1304     1304           
Files Coverage Δ
alibi/explainers/partial_dependence.py 94.21% <100.00%> (+0.02%) ⬆️

ax_group[0][0].get_shared_y_axes().join(ax_group[0][0], *[ax[0] for ax in ax_group[1:]])
ax_group[0][0].set_ylim(min_val, max_val)
axs = [ax[0] for ax in ax_group]
for ax1, ax2 in zip(axs, axs[1:]):
Copy link
Collaborator

@RobertSamoilescu RobertSamoilescu Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the zip necessary? I was thinking of something like:

for ax in axs[1:]:
    ax.sharey(axs[0])

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I've changed to your suggestion and tested that it works the same, the code is slightly nicer!

Copy link
Collaborator

@RobertSamoilescu RobertSamoilescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jklaise jklaise merged commit 7f1d48e into SeldonIO:master Sep 27, 2023
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PDP plots failing with matplotlib==3.8.0
2 participants