Skip to content

SHAP Analysis Plot

🧩 What is this?

The VIP plot and regression coefficient plot introduced earlier both answer "who is important overall". But they share a common limitation: they only give an average conclusion.

In reality this situation often occurs:

A variable makes a positive contribution on some samples, but is a negative drag on others.

SHAP (SHapley Additive exPlanations) is used to reveal this kind of individual difference. It originates from the Shapley value in game theory, and fairly splits each prediction of the model across the variables:

"In this prediction result, how much did each variable contribute?"


🧐 How to read?

The SHAP analysis plot usually contains two views:

View 1: Importance bar chart (horizontal bars)

  • Sorted by mean absolute SHAP value, with the most important variable at the top
  • The longer the bar, the greater the variable's overall influence on the model output

💡 This chart plays a role similar to the VIP plot, but with a different theoretical basis: VIP is based on projected variance, SHAP is based on game-theoretic allocation; the two corroborating each other is more convincing.

View 2: Beeswarm plot

One row per variable, one point per sample:

Visual elementMeaning
Horizontal positionThe SHAP value of this variable on that sample——positive pushes the prediction up, negative pulls it down
Point colorThe variable's actual value on this sample (usually darker is a higher value)
Degree of point dispersionThe more dispersed, the more unstable and dependent on the specific operating condition the variable's influence is

The most classic readings of the beeswarm plot:

PatternConclusion
High-value points concentrated on the right, low-value points on the leftThe variable, the larger it is, the more it pushes the result up (monotonic positive correlation)
High-value points concentrated on the left, low-value points on the rightThe variable, the larger it is, the more it pulls the result down (monotonic negative correlation)
Points mixed left and right, not clearly separatedThe variable's influence is non-monotonic, and there is an optimal range
The whole row of points huddled near 0The variable has almost no influence on the model

💡 "Mixed left and right" is actually good news: it often means this variable has an optimal value range——too small is no good, and too large is no good either. This is exactly the goal of process optimization.


🛠️ How to use?

No additional configuration is needed; drag in the chart to generate it.

Typical uses

PurposeMethod
Validate the VIP conclusionThe SHAP importance ranking roughly agrees with the VIP ranking → the conclusion is reliable
Find non-monotonic variablesFind rows in the beeswarm plot that are mixed left and right → such variables have an optimal range and are the focus of optimization
Explain a single abnormal sampleUse the Data Table to locate the sample → look at its SHAP values on each variable
Explain the model to business stakeholders"This prediction is on the high side, mainly because temperature contributed +0.8 and pH contributed −0.3"

Key differences from the regression coefficient plot

DimensionRegression Coefficient PlotSHAP Analysis Plot
GranularityOne global coefficientOne set of values per sample
Non-linearityCannot captureCan capture non-monotonic relationships
Interaction effectsCannot captureCan reflect interactions between variables
ReadabilitySimpler and more intuitiveLarge amount of information, takes getting used to

⚠️ Notes

  • Only supervised models are supported (PLS / PLS-DA / OPLS / OPLS-DA)
  • SHAP for OPLS is computed from equivalent coefficients: the platform has projected the corrected coefficients back into the original variable space, so the conclusions correspond to the original process variables
  • SHAP explains the "model", not "reality": it explains why the model predicts this way, which is not the same as a causal relationship in the business
  • The larger the sample size, the more stable: when there are very few samples the shape of the beeswarm plot may be misleading
  • To confirm causation, use Causal Inference (DML)

Let data speak, make decisions simpler.