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 label option #3636

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fix label option #3636

wants to merge 3 commits into from

Conversation

SFatemehM
Copy link

@SFatemehM SFatemehM commented May 1, 2024

Fixes label option for more than 1 row

Overview

When there is more than one pixel_values as test images in shap.plots.image and the labels option is defined, there will be more than 1 rows in the plot and when setting titles this error rises:

IndexError: index 1 is out of bounds for axis 0 with size 1

It can be fixed by checking row==0 and setting titles for the first row only.

Checklist

  • All pre-commit checks pass.
  • Unit tests added (if fixing a bug or adding a new feature)

fix label option for more than 1 row - convert shap_value to list with compatible dimensions for plotting
@connortann connortann added the visualization Relating to plotting label May 3, 2024
Fix label option for more than 1 row
@SFatemehM SFatemehM changed the title Update _image.py Fix label option May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
visualization Relating to plotting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants