def xgb_shap_values(x): bst = xgb.Booster() bst.load_model("my_model") explainer = shap.TreeExplainer(bst) return explainer.shap_values(x)
def xgb_shap_values(x): bst = xgb.Booster() bst.load_model("my_model") explainer = shap.TreeExplainer(bst) return explainer.shap_values(x), explainer.shap_interaction_values( x), explainer.expected_value