shap.plots.beeswarm(shap_values, max_display=10, order=shap.Explanation.abs.mean(0), clustering=None, cluster_threshold=0.5, color=None, axis_color='#333333', alpha=1, show=True, log_scale=False, color_bar=True, s=16, plot_size='auto', color_bar_label='Feature value')

Create a SHAP beeswarm plot, colored by feature values when they are provided.


This is an Explanation object containing a matrix of SHAP values (# samples x # features).


How many top features to include in the plot (default is 10, or 7 for interaction plots).


Whether is called before returning. Setting this to False allows the plot to be customized further after it has been created, returning the current axis via plt.gca().


Whether to draw the color bar (legend).


What size to make the markers. For further information see s in matplotlib.pyplot.scatter.

plot_size“auto” (default), float, (float, float), or None

What size to make the plot. By default, the size is auto-scaled based on the number of features that are being displayed. Passing a single float will cause each row to be that many inches high. Passing a pair of floats will scale the plot by that number of inches. If None is passed, then the size of the current figure will be left unchanged.


See beeswarm plot examples.