Shap Summary Plots
Python
Here we use the Shap library to evaluate the features in our model. The first summery plot outputs a simple bar chart with features listed in order of importance. The 2nd plot again shows the features listed in order of importance but also how much, both positively and negatively the feature impacts the model.
1| import shap 2| shap.initjs() 3| 4| shap_values = shap.TreeExplainer(model).shap_values(X_train) 5| 6| shap.summary_plot(shap_values, X_train, plot_type="bar") 7| shap.summary_plot(shap_values, X_train)
149
132
127
119