shap icon indicating copy to clipboard operation
shap copied to clipboard

ENH: how does pytorch network model use shap.DeepExplainer()

Open ZhangFangjuan opened this issue 8 months ago • 2 comments

Problem Description

the model is wideDeep,and my code as: Image

the problem is: AssertionError: The SHAP explanations do not sum up to the model's output! This is either because of a rounding error or because an operator in your computation graph was not fully supported. If the sum difference of %f is significant compared to the scale of your model outputs, please post as a github issue, with a reproducible example so we can debug it. Used framework: pytorch - Max. diff: 0.8651237874997961 - Tolerance: 0.01

Alternative Solutions

No response

Additional Context

No response

Feature request checklist

  • [x] I have checked the issue tracker for duplicate issues.
  • [ ] I'd be interested in making a PR to implement this feature

ZhangFangjuan avatar Apr 23 '25 08:04 ZhangFangjuan

You might find your answer here: https://github.com/shap/shap/issues/3263

You should not rely on your shap-outputs as long as you get this error.

noxthot avatar Apr 29 '25 07:04 noxthot

The most likely issue is that your model contains an unsupported layer. Did you encounter any warnings that might hint that?

CloseChoice avatar May 06 '25 14:05 CloseChoice