LearnSHAP Values: Explaining ML Model Predictions
Advanced8 min readSource-backed

SHAP Values: Explaining ML Model Predictions

Understand how SHAP (SHapley Additive exPlanations) values measure each feature's contribution to individual predictions — and how to present them to clinical audiences.

You'll learn

How SHAP values quantify each feature's contribution to individual predictions and how to present them to clinical audiences.

Use this when

You have a trained ML model and need to explain which variables drive its predictions.

Try this in VibeResearch

Why Explainability Matters in Clinical ML

A black-box model that says "this patient has 73% risk of readmission" is clinically useless without knowing why. Clinicians need to know which factors drove the prediction to decide whether to trust it and how to act on it. SHAP values provide this explanation at the individual patient level.

📖 What SHAP values are

SHAP values are derived from cooperative game theory (Shapley values). For each prediction, a SHAP value is assigned to every feature. The SHAP value for feature X represents: "how much did X contribute to pushing this prediction above or below the average prediction?" Positive SHAP = X increased the predicted risk; negative SHAP = X decreased it.

Types of SHAP Plots

Plot typeWhat it showsUse case
Summary plot (beeswarm)Distribution of SHAP values for each feature across all patientsGlobal feature importance + direction of effect
Bar chart (mean |SHAP|)Average absolute SHAP value per feature — pure importance rankingQuick global importance comparison
Waterfall plotIndividual patient breakdown — features pushing up or down from baselineExplaining a single prediction to a clinician
Dependence plotSHAP value vs feature value for one variableNon-linear effects and interactions

In VibeResearch, the ML Prediction tool generates both the summary (beeswarm) plot and bar chart. Select a model from the SHAP tab to explore feature contributions.

How to Read a SHAP Summary Plot

On a SHAP summary plot, each row is a feature (ordered by importance, most important at top). Each dot is a patient. The x-axis shows the SHAP value — rightward dots increase predicted risk, leftward dots decrease it. The color shows the feature value (red = high, blue = low).

  • A wide spread of dots means the feature has highly variable impact across patients
  • If red dots (high values) are on the right, higher values of that feature increase risk
  • If red dots are on the left, higher values decrease risk (protective effect)
  • A feature with all dots near zero has little impact on predictions — effectively unused by the model

⚠️ SHAP ≠ causal effect

SHAP values describe how the model uses features, not causal effects. If age and a biomarker are correlated, SHAP may attribute importance to one and not the other depending on the model. Do not interpret SHAP values as regression coefficients or as evidence that a feature causes the outcome.

Reporting SHAP in a Paper

  1. 1.State which SHAP variant was used (TreeSHAP for tree models, KernelSHAP for others)
  2. 2.Include the summary plot (beeswarm or bar chart) showing the top 10–15 features
  3. 3.For the primary model: report the five most important features with their direction of effect
  4. 4.State explicitly that SHAP values are model explanations, not causal estimates
  5. 5.Optionally include a waterfall plot for one representative high-risk and low-risk case as a supplement

Practice with your own dataset

Explore SHAP values for your trained ML model.

  1. 1.Train a model in Analyze → ML Prediction
  2. 2.Go to the SHAP tab in the results section
  3. 3.View the summary (beeswarm) plot showing feature contributions across all patients
  4. 4.Use the bar chart to identify the most important features by mean |SHAP|
  5. 5.Download the SHAP plots for your paper

Read next

Cross-Validation: A More Honest Model Evaluation

Learn why a single train/test split is not enough and how k-fold cross-validation gives a more reliable estimate of how your model will perform in the real world.

Intermediate7 min read
Read next