Warm tip: This article is reproduced from stackoverflow.com, please click
python shap

How do i get my SHAP plot to display more than 20 variables?

发布于 2020-12-24 00:08:21

How do i get my SHAP plot to display more than 20 variables in my chart. Here is my code:

shap.initjs()
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X_train)

shap.summary_plot(shap_values, X_train)
plt.savefig(Config.CLASH_PATH + '/plots/shap_' + target_cols + '.png')
plt.close()

SHAP graph

Questioner
C. Cooney
Viewed
0
40.9k 2020-11-03 22:47

Use option max_display=30 in shap.summary_plot().