Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

shap_values.base_values become weird when the size of maskers is larger than 100. #2487

Closed
yipei-wang opened this issue Apr 8, 2022 · 3 comments
Labels
stale Indicates that there has been no recent activity on an issue

Comments

@yipei-wang
Copy link

I tried a simple model model with input data x and background data X. The exact SHAP is implemented as

explainer = shap.explainers.Exact(model, X)
shap_values = explainer(x)

From the paper, I expect that shap_values.base_values[0,0] should be equivalent to model(X).mean(). But the I found that this is true only if X.shape[0]<=100. When the number of samples in X is greater than 100, the reference value becomes weird and I don't know how it is calculated.

I am confounded by this phenomenon, am I doing it wrong? I really appreciate it if anyone can help me with this issue!

@AnotherSamWilson
Copy link

This is probably caused by a hard coded limitation to 100 samples in the background set:
#1991

Caused by this guy:
https://github.com/slundberg/shap/blob/b6e90c859fdfc6bc145242d9a8082d4ad844e995/shap/maskers/_tabular.py#L243

Copy link

This issue has been inactive for two years, so it's been automatically marked as 'stale'.

We value your input! If this issue is still relevant, please leave a comment below. This will remove the 'stale' label and keep it open.

If there's no activity in the next 90 days the issue will be closed.

@github-actions github-actions bot added the stale Indicates that there has been no recent activity on an issue label Jun 16, 2024
Copy link

This issue has been automatically closed due to lack of recent activity.

Your input is important to us! Please feel free to open a new issue if the problem persists or becomes relevant again.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 14, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
stale Indicates that there has been no recent activity on an issue
Projects
None yet
Development

No branches or pull requests

2 participants