explainer = shap.TreeExplainer(model) shap_values = explainer.shap_values(X_instance)