shap.dependence_plot
是否可以在shap
Python 包的结果中添加回归线?
玩具示例:
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)
是否可以以简单的方式绘制像 LOESS 这样的回归线?