I have trained a lightGBM model using this code:
from flaml import AutoML
#Select Hyper-Parameters
automl_final = AutoML()
automl_final.fit(
X_train,
y_train,
estimator_list=["lgbm"],#,"xgboost"],
task="classification",
metric="roc_auc",
eval_method="cv",
n_splits=3,
time_budget=30,
sample=True,
append_log=True,
log_type="all",
model_history=True,
log_training_metric=True,
verbose=3,
seed=1234,
early_stop=True
)
Then I have generated a SHAP bar plot using this code:
lgbm = automl_final.model.estimator
explainer = shap.TreeExplainer(lgbm)
shap_values = explainer.shap_values(X_test)
shap.summary_plot(shap_values, X_test,plot_type="bar")
And I got this plot (as expected):
Now, I would like to see a SHAP plot like the following one:
So I have used this code instead:
shap.summary_plot(shap_values, X_test)
And I still get the same SHAP bar-chart plot as before:
Does anybody know how to generate a plot similar to this one (for lightgbm - for xgboost the code works fine):
shap.plots.beeswarm(shap_values)
Please check the documentation if needed.