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
๐ด 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
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