Skip to content

Visualize SHAP values of top features by magnitude and direction

Notifications You must be signed in to change notification settings

nick-phillips/shap_barplot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

SHAP Barplot

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.

example plot

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.

Usage

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)

About

Visualize SHAP values of top features by magnitude and direction

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages