Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/shapPublic
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Add Interaction Order to Explanation Class#3939

Open
CloseChoice wants to merge13 commits intomaster
base:master
Choose a base branch
Loading
fromimage-plot-3874

Conversation

CloseChoice
Copy link
Collaborator

@CloseChoiceCloseChoice commentedDec 30, 2024
edited
Loading

Overview

Closes#3874

Description of the changes proposed in this pull request:

  • the issue here was, that neitherbase_values noroutput_names was provided when creatingExplanation instances from the DeepExplainer which resulted in an empty tuple asExplanation.output_dims, which then caused problems in theimage_plot. We solve this here in two different fashions: 1. set the base_values correctly, 2. add interaction_order. Each of these solutions would be fine by itself, but I think, the interaction_order can help to track down if everything was done correctly and helps to understand theExplanation's shap_values better.
  • addinteraction_order to the explanation class. This is either0 for no interactions or1 if interactions are present. I also added this to a couple of tests.

Checklist

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

@CloseChoiceCloseChoice marked this pull request as ready for reviewDecember 30, 2024 22:52
)

# define the model architecture
inputs = tf.keras.Input(shape=(32, 32, 3))
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

we have a problem here. Retraining this won't reproduce the image. Any ideas how we can get this to work? I would like to reproduce the issue from the ticket

Copy link
CollaboratorAuthor

@CloseChoiceCloseChoice left a comment

Choose a reason for hiding this comment

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

I don't understand why the tests fail. Just from the files that differ it looks like my test has something to do with it but when looking at the diffs I cannot understand why. I also cannot reproduce the issue locally.

@CloseChoice
Copy link
CollaboratorAuthor

Okay, just found that exactly these tests fail in other pipelines as well. Will try to reproduce and create a fix

@CloseChoice
Copy link
CollaboratorAuthor

I think this was closed in the mean time

@CloseChoice
Copy link
CollaboratorAuthor

is it really closed, take a deeper look

@codecovCodecov
Copy link

codecovbot commentedMar 22, 2025

Codecov Report

Attention: Patch coverage is86.66667% with2 lines in your changes missing coverage. Please review.

Project coverage is 64.80%. Comparing base(d5ce4c7) to head(9df6bb8).

Files with missing linesPatch %Lines
shap/explainers/_deep/__init__.py80.00%2 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##           master    #3939      +/-   ##==========================================+ Coverage   64.78%   64.80%   +0.01%==========================================  Files          92       92                Lines       12895    12905      +10     ==========================================+ Hits         8354     8363       +9- Misses       4541     4542       +1

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • ❄️Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CloseChoiceCloseChoice changed the titleImage plot 3874Add Interaction Order to Explanation ClassMar 23, 2025
@CloseChoice
Copy link
CollaboratorAuthor

Note that this PR solves the issue only for the__call__ method,.shap_values is left unchanged

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@connortannconnortannAwaiting requested review from connortann

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

BUG: shap.image_plot bug when using DeepExplainer
2 participants
@CloseChoice@connortann

[8]ページ先頭

©2009-2025 Movatter.jp