liveBook · Manning

Beeswarm plot

As explained in Outlier Detection in Python

A beeswarm plot displays individual observations as positioned dots, often using color to encode feature values or another variable.

A beeswarm plot displays individual observations as dots for each feature, positioning them to reveal feature importance and coloring them by the corresponding feature value. section 13.2.1

Within SHAP explanations for an Isolation Forest, blue, purple, and red dots indicate low, average, and high values. High values usually increase outlier scores, although Length reverses that pattern. section 13.2.1

Create a SHAP beeswarm plot

After generating a SHAP explanation for the original features, render it with shap.plots.beeswarm(explanation). The resulting plot summarizes global feature contributions across records. section 13.2.1

shap.initjs()
shap.plots.beeswarm(explanation)

The runnable SHAP call directly produces the beeswarm visualization used to inspect global feature importance. section 13.2.1

How Outlier Detection in Python covers it

How deep it goes
Shows per-instance dots and color-coded values but does not display the complete feature–target relationship.
Examples
Uses SHAP explanations on an Isolation Forest applied to an abalone dataset.
What it assumes
Assumes a fitted detector and SHAP explanation object, while making color-based interpretation central to reading the plot.
What you can do after
Evaluate global feature effects by reading dot positions and color patterns in a SHAP visualization.
How it connects
Connects SHAP explanations, feature importance, Isolation Forest, outlier scores, and global model interpretation.

Also explained in

Compare how 2 books explain beeswarm plot →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Outlier Detection in Python. The section links point to the parts of the book it draws on.