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 element | Meaning |
|---|---|
| Horizontal position | The SHAP value of this variable on that sample——positive pushes the prediction up, negative pulls it down |
| Point color | The variable's actual value on this sample (usually darker is a higher value) |
| Degree of point dispersion | The 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:
| Pattern | Conclusion |
|---|---|
| High-value points concentrated on the right, low-value points on the left | The 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 right | The variable, the larger it is, the more it pulls the result down (monotonic negative correlation) |
| Points mixed left and right, not clearly separated | The variable's influence is non-monotonic, and there is an optimal range |
| The whole row of points huddled near 0 | The 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
| Purpose | Method |
|---|---|
| Validate the VIP conclusion | The SHAP importance ranking roughly agrees with the VIP ranking → the conclusion is reliable |
| Find non-monotonic variables | Find 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 sample | Use 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
| Dimension | Regression Coefficient Plot | SHAP Analysis Plot |
|---|---|---|
| Granularity | One global coefficient | One set of values per sample |
| Non-linearity | Cannot capture | Can capture non-monotonic relationships |
| Interaction effects | Cannot capture | Can reflect interactions between variables |
| Readability | Simpler and more intuitive | Large 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)
🔗 Related reading
- VIP Variable Contribution —— importance ranking based on projected variance
- Regression Coefficient Plot —— global coefficients and directions
- S-Plot Marker Plot —— two-dimensional screening of contribution + reliability