Project case study · Explainable health-data analysis

Explaining what drives a model’s mortality-risk output.

Toward Precision Medicine: Explaining Mortality Risk Predictions in Heart Failure Patients

Ongoing exploratory health-data analytics projectClassification and explainability phase completeSurvival analysis planned

Dataset

299 records
13 variables
Public heart-failure clinical records data

Problem

A classifier can produce a score. What is pushing that output up or down?

Why it matters

Aggregate performance does not explain how the model behaves for an individual record, or where that behavior breaks down. This project pairs model comparison with SHAP explanations and error analysis.

A consequential feature decision

Follow-up time was excluded from classification.

The dataset includes a time variable that records follow-up duration. Using it as a classification feature risks giving the model information entangled with how long a patient was observed. I excluded it from the classifier inputs to reduce leakage risk.

Included

Clinical and demographic variables used in the exploratory classification setup.

Excluded

Follow-up time as a classification feature.

Outcome

Death-event label used for the binary classification analysis.

Global model behavior

SHAP shows how each feature shifts the fitted model output.

Each point represents a record. Its horizontal position indicates whether that feature value pushes the model output higher or lower relative to its reference value. Color shows whether the observed feature value is relatively high or low.

Important: these are model attributions. They are not causal effects, clinical recommendations, or proof of a valid patient-care risk estimate.

SHAP beeswarm for the tuned logistic-regression heart-failure classifier, with ejection fraction, age, and serum creatinine among the leading features
Open the logistic-regression SHAP summary at full size (opens in a new tab)
Tuned logistic regression · Global SHAP summary. Features are ordered by their average absolute contribution to the fitted model output.Reading the figure. The spread shows that feature contributions vary by record. Direction and magnitude belong to this fitted model and dataset; they should not be read as causal medical relationships.
02

Individual explanations

Three illustrative records. None is a global extreme.

These examples were selected to show a true positive, true negative, and false positive. They should not be described as the dataset’s highest-risk, lowest-risk, or otherwise globally selected cases.

Tuned gradient-boosting SHAP waterfall for an illustrative true-positive classification example
Open the true-positive SHAP example at full size (opens in a new tab)
Tuned gradient boosting · Illustrative true positive: the model output and observed class agree for this test example.Reading the figure. The bars show how the record’s features move the model output away from its baseline. Agreement on one example does not establish clinical reliability.
Tuned gradient-boosting SHAP waterfall for an illustrative true-negative classification example
Open the true-negative SHAP example at full size (opens in a new tab)
Tuned gradient boosting · Illustrative true negative: the model output and observed class agree for this test example.Reading the figure. The explanation is local to this record and model. It does not describe a general protective effect.
Tuned gradient-boosting SHAP waterfall for an illustrative false-positive classification example
Open the false-positive SHAP example at full size (opens in a new tab)
Tuned gradient boosting · Illustrative false positive: the classifier flagged a death event for a record whose observed label was negative.Reading the figure. This error shows why an apparently coherent explanation is not the same as a correct prediction. Interpretation must be paired with error analysis.

The source waterfall graphics use “probability” in their embedded titles. On this site, those values are treated as classifier model outputs—not as calibrated clinical risk probabilities.

Why the false positive matters

An explanation can be internally clear and still explain a mistake.

The false-positive waterfall assigns understandable contributions to the record’s features. That does not rescue the prediction. It gives a better view of why the fitted model crossed its decision threshold on this example—and a concrete place to ask whether the learned pattern is stable, biased, or too sensitive.

This is the practical value of explainability here: not a certificate of trust, but a way to inspect model behavior and its failures more closely.

Current status

The classification and explainability phase is complete.

The project currently covers exploratory preprocessing, classifier comparison, global SHAP analysis, and individual error examples. Survival analysis is planned as a later phase and is not represented as completed work.