Back to Research
Explainable AI

How We Explain Predictions

A prediction without an explanation is just a number. We use SHAP and LIME to make every prediction transparent and understandable.

Why Explainability Matters in Healthcare

A machine learning model might achieve 90% accuracy, but if a clinician cannot understand why it flagged a patient as high risk, they cannot act on it with confidence. Explainable AI bridges this gap โ€” it doesn't just predict, it explains.

In healthcare, explainability also builds patient trust. When a patient is told their BMI and physical inactivity are the primary drivers of their elevated risk, that is actionable information they can take to their doctor and act on.

SHAPSHapley Additive exPlanations

SHAP is grounded in cooperative game theory. It asks: if each feature is a "player" in a game, how much does each one contribute to the final prediction?

For every prediction, SHAP produces a value for each feature. Positive values push the prediction toward higher risk; negative values push it toward lower risk. The magnitude shows how strongly that feature influenced the outcome.

Global SHAP

Averaged across all predictions to show which features matter most for the model overall. Glucose and BMI consistently rank highest.

Local SHAP (Waterfall)

For a single patient, shows exactly how each of their 14 features pushed the prediction up or down from the baseline.

Example SHAP waterfall โ€” single patient

Glucose
+0.42
BMI
+0.21
Age
+0.13
Hypertension
+0.09
Physical Activity
-0.11
Income Level
-0.06

๐Ÿ”ด Red = increases risk ยท ๐ŸŸข Green = decreases risk

LIMELocal Interpretable Model-Agnostic Explanations

LIME works differently from SHAP. For a single prediction, it creates thousands of slightly perturbed versions of that patient's data, runs them through the model, and fits a simple linear model to approximate the complex model's behaviour locally.

The result is a ranked list of feature conditions โ€” readable statements like "Glucose > 140 increases risk" โ€” that explain this specific prediction in plain language.

LIME is model-agnostic, meaning it works with any black-box model. This makes it a useful cross-check alongside SHAP.

Example LIME explanation โ€” same patient

Glucose > 140increases risk
BMI > 30increases risk
Age category = 50โ€“54increases risk
No physical activityincreases risk
Income level โ‰ฅ 7decreases risk
No kidney diseasedecreases risk

Human-readable conditions โ€” not raw feature values.

SHAP vs LIME โ€” When We Use Each

SHAP

  • โ†’Global feature importance across all patients
  • โ†’Waterfall plots in prediction results
  • โ†’Batch analytics โ€” population-level insights
  • โ†’PDF report feature attribution table

LIME

  • โ†’Local explanation for individual predictions
  • โ†’Plain-English condition statements
  • โ†’Cross-checking SHAP for consistency
  • โ†’Patient-facing explanations in reports