shap.utils.approximate_interactions

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

Order other features by how much interaction they seem to have with the feature at the given index.

This just bins the SHAP values for a feature along that feature’s value. For true Shapley interaction index values for SHAP see the interaction_contribs option implemented in XGBoost.