Is it possible to add a regression line to the result of shap.dependence_plot
of the shap
Python package?
Toy example:
import xgboost
import shap
# train XGBoost model
X,y = shap.datasets.adult()
model = xgboost.XGBClassifier().fit(X, y)
# compute SHAP values
explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X)
# The shap dependence plot
shap.dependence_plot("Age", shap_values, X)
would be possible to plot in a simple way a regression line like LOESS?
You can try: