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

Possible to Generate Summary Plots and Dependence Plots using SKLearn Models? #31

Closed
Keita1 opened this issue Feb 4, 2018 · 3 comments

Comments

@Keita1
Copy link

Keita1 commented Feb 4, 2018

Hi,

Thanks for this wonderful resource! It has enhanced my work greatly.

I was wondering if it is possible to generate Summary and Dependence plots using SKLearn generated models. I have been able to duplicate your work using my own data trained on Sklearn's forest models. But I have not been able to create the plots in question. I also notice you don't include them in your sklearn examples.

Any help or hint is appreciated!

Thanks,

Keita

@Keita1 Keita1 changed the title Possible to Generate Summary Plots and Dependence Plots using SKLearn Models Possible to Generate Summary Plots and Dependence Plots using SKLearn Models? Feb 4, 2018
@slundberg
Copy link
Collaborator

slundberg commented Feb 5, 2018 via email

@slundberg
Copy link
Collaborator

FYI: I just added a new function that will make it easier to make summary and dependence plots from the model agnostic Kernel SHAP explainer.

Following the model agnostic (multi-class) example from the front page we can now get:

explainer = shap.KernelExplainer(svm.predict_proba, X_train, nsamples=100, link="logit")
shap_values = explainer.shap_values(X_test)

# plot the SHAP values for the Setosa output of the first instance
shap.summary_plot(shap_values[0], X_test[0])

@Keita1
Copy link
Author

Keita1 commented Mar 25, 2018

Thanks for responding and adding additional functionality!!

connortann added a commit to prabathbr/shap that referenced this issue Jun 2, 2023
* Remove unused imports

* Move fixture to conftest.py

* Enable rule F401

* Remove one more import
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

2 participants