, max_display=10, order=shap.Explanation.abs, clustering=None, clustering_cutoff=0.5, merge_cohorts=False, show_data='auto', show=True)

Create a bar plot of a set of SHAP values.

If a single sample is passed then we plot the SHAP values as a bar chart. If an Explanation with many samples is passed then we plot the mean absolute value for each feature column as a bar chart.

shap_valuesshap.Explanation or shap.Cohorts or dictionary of shap.Explanation objects

A single row of a SHAP Explanation object (i.e. shap_values[0]) or a multi-row Explanation object that we want to summarize.


The maximum number of bars to display.


If show is set to False then we don’t call the function. This allows further customization of the plot by the caller after the bar() function is finished.