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
BUG: shap.maskers.Impute() throws TypeError #3378
Comments
Thanks for the bug report. I can reproduce this on master. As far as I can see the problem is that the Impute masker does not overwrite the @stompsjo I see that you are interested in a PR to fix this. Feel free to dive into this a bit and ask for help if you are stuck. |
I am happy to start a PR, but I think getting Lines 316 to 319 in b99ab20
I tried tracking down the history of this class, and I see that there is a more complete implementation in the branch |
I agree that the For implementing I would just fall back to the sklearn imputers or check the work of @maggiewu19 first. Everything else, e.g. researching suitable imputation methods (see here or here) should be done in a separate issue. |
Issue Description
shap.maskers.Impute()
in version 0.42.1 is throwing the following TypeError when used in anExplainer
object. This is regardless of model or data type (minimal reproducible example below uses a toy example that was not the first time I encountered this problem). It seems like this problem would likely be encountered in other (albeit much older) issues like #1723. It's entirely possible that I am not usingImpute
orExplainer
properly, in which case I would appreciate any corrections. 😄From what I can tell in the source code,
Impute
has not implemented a__call__
function and is inheriting the blank__call__
function fromMasker
, its parent. There's a comment that it should eventually be inheriting fromTabular
once arbitrary masking is supported. Should this be changed, or can someone expand on this? Thanks for the help!P.S. Given the latest source code and release notes, it is not clear to me that 0.43.0 resolves this issue, or that the issue is resolved on the master branch.
Minimal Reproducible Example
Traceback
Expected Behavior
No response
Bug report checklist
Installed Versions
0.42.1
The text was updated successfully, but these errors were encountered: