Skip to content
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

shap v0.36.0 causes error in force_plot #12

Closed
hfshr opened this issue Oct 21, 2020 · 15 comments
Closed

shap v0.36.0 causes error in force_plot #12

hfshr opened this issue Oct 21, 2020 · 15 comments

Comments

@hfshr
Copy link

hfshr commented Oct 21, 2020

Hi Brandon,

Thanks for the great package. I've noticed that shap v0.36.0 made some changes to the API that causes fastshap::force_plot to fail. Specifically, shap$save_html(tfile, plot_html = fp) needs to be changed to shap$save_html(tfile, plot = fp) to work with the latest version of shap.

Not sure what the best workaround would be, either requiring the latest version of shap or maybe if the original method throws an error, try again with the new method?

@bgreenwell
Copy link
Owner

Thanks @hfshr for figuring out the issue, I’ll try to figure out a good workaround!

@jbwoillard
Copy link

Hi Brandon, I think that I have a related error and I don't know how to fix it when running the force_plot demo script
Error in py_call_impl(callable, dots$args, dots$keywords) : TypeError: save_html() got an unexpected keyword argument plot_html
Could you help me with that?
Thanks+
jb

@bgreenwell
Copy link
Owner

Thanks @jbwoillard, I'll push a change this weekend.

@bgreenwell
Copy link
Owner

@hfshr, @jbwoillard this should be fixed now if anyone wants to confirm!

@jbwoillard
Copy link

Dear bgreenwell, I have made a try but still have the same error message. I also have trouble to load the last version from github, I ask a friend to try it but he reported the same error.

@bgreenwell
Copy link
Owner

@jbwoillard Hmm, not sure what the issue is, but I definitely see a problem on my end. What error message did you get after trying to install?

@jbwoillard
Copy link

Sorry, here you have it
ERROR: failed to lock directory 'C:/Program Files/R/R-4.0.2/library' for modifying Try removing 'C:/Program Files/R/R-4.0.2/library/00LOCK-fastshap' Erreur : Failed to install 'fastshap' from GitHub: (converti depuis l'avis) installation of package ‘C:/Users/woillp01/AppData/Local/Temp/RtmpiarQpB/file4acc451b157d/fastshap_0.0.5.tar.gz’ had non-zero exit status

@bgreenwell
Copy link
Owner

@jbwoillard it's hopefully fixed now. Had to make some other changes (some how the last version I pushed was corrupt). I'm experimenting with some new reticulate options, so I expect more changes before the next CRAN release. I tested it out on old and new versions of shap here: https://github.com/bgreenwell/fastshap/blob/master/slowtests/sfastshap-force_plot.R. Let me know if you still experience issues.

@hfshr
Copy link
Author

hfshr commented Feb 22, 2021

I just had a chance to try this out quickly and worked perfectly for me with shap 0.38.1, thanks @bgreenwell!

@RoelVerbelen
Copy link

Works again, thanks for the fix @bgreenwell !

@jbwoillard
Copy link

@bgreenwell thanks, that works :) (for me with only with the old version shap 0.35.0)

@bgreenwell
Copy link
Owner

Looks like the shap API has changed again: https://github.com/slundberg/shap/blob/master/shap/plots/_force.py. This will likely cause an error when working with the latest version of shap.

@jonesworks
Copy link

jonesworks commented Aug 17, 2021

pip install ipython
pip install shap==0.35.0

pkg_resources.require("shap==0.35.0")

This worked for me. (Thanks for the package btw! Awesome.

@nasirudeenraheem
Copy link

@bgreenwell
Copy link
Owner

All plotting functions have been deprecated in favor of using shapviz.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants