Код: Выделить всё
fig, ax = plt.subplots(nrows=1, ncols=2, figsize=(8,20))
for (X, y) in [(x1, y1), (x2, y2)]:
model = xgboost.XGBRegressor().fit(X, y)
explainer = shap.Explainer(model, check_additivity=False)
shap_values = explainer(X, check_additivity=False)
shap.plots.bar(shap_values, max_display=6, show=False) # ax=ax ??
plt.show()
Подробнее здесь: https://stackoverflow.com/questions/766 ... -bar-plots