A comparative study of seven supervised learning models — from interpretable baselines to deep neural networks — applied to a clinical dataset of 5,888 patient records to predict heart failure outcomes and evaluate the tradeoffs between accuracy and explainability.
Congestive heart failure (CHF) affects more than 6 million Americans and carries a five-year mortality rate approaching 50%. The condition occurs when the heart can no longer pump blood efficiently, leading to fluid buildup, organ stress, and progressive decline. Early identification of high-risk patients dramatically improves outcomes — but clinical prediction remains difficult because CHF shares symptoms with many conditions, and individual risk factors interact in complex, nonlinear ways.
The core question driving this project: can a machine learning model trained on routine clinical measurements reliably classify patients by heart failure outcome? And if so, which model best balances predictive accuracy with the explainability that clinical decision-making demands?
Dataset: 5,888 patient records with 12 clinical features — including ejection fraction (percentage of blood pumped per heartbeat), serum creatinine (kidney function), serum sodium (electrolyte balance), creatinine phosphokinase, and platelets — alongside binary indicators for anaemia, diabetes, high blood pressure, sex, and smoking status. An 80/20 train-test split was used across all models.
All models were trained on standardized features and evaluated on accuracy and F1 score. The Deep Neural Network outperformed every other model — but the gap between it and Random Forest raises a meaningful question about when 1.6 percentage points of accuracy is worth sacrificing interpretability.
Test set: 1,178 patients (20% holdout)
The DNN correctly classified 1,123 of 1,178 test patients — a 95.3% accuracy rate. Of the 55 errors, 35 were false negatives (CHF patients classified as healthy) and 20 were false positives (healthy patients flagged as CHF).
In a clinical context, false negatives carry the higher cost: a missed CHF case may delay life-saving intervention. The model's 95.1% recall means it correctly identified 672 of 707 true CHF patients — strong performance, but one that warrants threshold tuning in real deployment to further minimize missed cases, even at the cost of more false alarms.
Key tradeoff: Random Forest reached 93.7% accuracy while offering feature importance rankings — giving clinicians a clear explanation of why a patient was flagged. In practice, that interpretability may outweigh a 1.6-point accuracy gap.
Feature importance from the Random Forest reveals which clinical measurements most strongly predict CHF outcomes. Two features dominate: ejection fraction — how much blood the heart pumps per beat — and serum creatinine, a marker of kidney function. The strong signal from follow-up time reflects that longitudinal data carries real predictive power, even when encoded as a single numeric value.