shap.utils.approximate_interactions

shap.utils.approximate_interactions(index, shap_values, X, feature_names=None)

根据其他特征与给定索引处的特征的交互程度对其进行排序。

这只是沿着特征值对特征的 SHAP 值进行分箱。对于 SHAP 的真实 Shapley 交互索引值,请参阅 XGBoost 中实现的 interaction_contribs 选项。