text_html_output_1.png
from sklearn.ensemble import RandomForestClassifier

import shap

model = RandomForestClassifier(random_state=1)
model.fit(X_train, y_train)

acc = model.score(X_test, y_test)

explainer = shap.TreeExplainer(model)
shap_values = explainer.shap_values(X_test)
shap.summary_plot(shap_values, X_test, class_names=model.classes_)