Open thatlittleboy opened 1 year ago
I had a look, and was able to piece back most of the code based on the locality of it, in particular https://github.com/slundberg/shap/blob/master/shap/explainers/_kernel.py was illuminating.
I have pushed the changes here but I have no idea as how to test; the comments are rather vague.
Also this seems to be related to this repo.
slundberg seems to be the main contributor there as well.
@EMorf Thanks for looking into this! Do you want to open a PR with the changes, so we can review the diffs more thoroughly?
but I have no idea as how to test
I'ld be happy with coverage for the .shap_values()
and .shap_interaction_values()
(but I see this is not implemented previously, we can raise a NotImplementedErrror for now and add a test for that) methods.
And looking at the tests within tests/explainers/
, we should check for the additivity (base_val + sum(shap_values) ~= model_output) at the minimum.
PR raised https://github.com/dsgibbons/shap/pull/92
Note that there are no ruff warnings now, but the code has not been tested. I will look into testing later, but any contributions are welcome.
Please see issue #33 for the background.
The original code for MimicExplainer was removed in PR #53 due to it being un-runnable.