【问题标题】:How do i get my SHAP plot to display more than 20 variables?如何让我的 SHAP 图显示超过 20 个变量?
【发布时间】:2020-08-15 13:36:57
【问题描述】:

如何让我的 SHAP 图在我的图表中显示 20 多个变量。这是我的代码:

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

【问题讨论】:

    标签: python shap


    【解决方案1】:

    shap.summary_plot() 中使用选项max_display=30

    【讨论】:

    • 你应该接受你自己的答案(这没有错),这样问题就不会显得仍然悬而未决。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-03-20
    • 1970-01-01
    • 2017-09-08
    • 1970-01-01
    • 1970-01-01
    • 2021-10-27
    • 1970-01-01
    相关资源
    最近更新 更多