Modified SHAP summary plot as a bar plot, showing both feature importance as a proportion of overall movement from baseline output and directionality as color. Only applicable to binary classification problems.
In the example above, f1
is the most important feature (contributing 18% to model output on average), and low values of the feature are correlated with positive classification.
X = <np.array of (# observations, # features)>
shap_values = <np.array of (# observations, # features)>
column_names = <List of column names>
from shap_barplot import barplot
barplot.shap_barplot(X, shap_values, column_names)