Python编程语言学习:shap.force_plot函数的源码解读之详细攻略

网友投稿 1189 2022-11-15

Python编程语言学习:shap.force_plot函数的源码解读之详细攻略

Python编程语言学习:shap.force_plot函数的源码解读之详细攻略

Python编程语言学习:shap.force_plot函数的源码解读之详细攻略

目录

​​shap.force_plot函数的源码解读​​

​​shap.force_plot(explainer.expected_value[1], shap_values[1][0,:], X_display.iloc[0,:])解读​​

shap.force_plot函数的源码解读

shap.force_plot(explainer.expected_value[1], shap_values[1][0,:], X_display.iloc[0,:])解读

def force(base_value, shap_values=None, features=None, feature_names=None, out_names=None, link="identity", plot_cmap="RdBu", matplotlib=False, show=True, figsize=(20,3), ordering_keys=None, ordering_keys_time_format=None, text_rotation=0, contribution_threshold=0.05):

功能

Visualize the given SHAP values with an additive force layout.

使用附加力图布局可视化给定的 SHAP 值。

参数

    Parameters

    ----------

base_value : float,This is the reference value that the feature contributions start from. For SHAP values it should be the value of explainer.expected_value.

这是特征贡献开始时的参考值。 对于SHAP值,它应该是 explainer.expected_value 的值。

shap_values : numpy.array,Matrix of SHAP values (# features) or (# samples x # features). If this is a 1D array then a single force plot will be drawn, if it is a 2D array then a stacked force plot will be drawn.

SHAP 值矩阵(# features)或(# samples x # features)。 如果这是一维数组,则将绘制单个力图,如果是二维数组,则将绘制堆叠力图。

features : numpy.array,Matrix of feature values (# features) or (# samples x # features). This provides the values of all the features, and should be the same shape as the shap_values argument.

特征值矩阵(# features)或(# samples x # features)。 这提供了所有特征的值,并且应该与shap_values参数的形状相同。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:如何系统学习LabVIEW?
下一篇:Nginx 面试题 40 问
相关文章

 发表评论

暂时没有评论,来抢沙发吧~