Heart Disease Prediction Model
On a one-time test of 61 held-out patients, the model caught 96.4% of heart disease cases with 86.9% accuracy, against a 54.1% baseline that catches none.
The question
Can routine, non-invasive measurements flag coronary heart disease before an invasive angiogram is done. The model works at the triage moment, so it only uses symptoms, physical measurements, and stress test indicators that are known beforehand.
The data
The data comes from the UCI Machine Learning Repository, Cleveland Clinic database, under CC BY 4.0. It covers 303 adult patients from a single center in 1988, and 67.9% are male, so the results describe that group and should not be read as general. I documented this limit before building anything.
How I kept the test honest
- I split the data 60/20/20 into training, validation, and test sets, stratified by the target.
- Cleaning and scaling steps sit inside each model pipeline, so they are fitted only on training folds and nothing leaks from the other sets.
- I chose the model, its settings, and the decision threshold using validation data only, then froze that decision in writing.
- The test set was used once, after the freeze, with no retuning afterwards.
Choosing the model
| Model | Mean ROC-AUC | Fit time |
|---|---|---|
| Logistic regression | 0.8928 ± 0.0447 | 0.061 s |
| Random forest | 0.8865 ± 0.0632 | 0.311 s |
The two scored close, but logistic regression varied less between folds and ran about five times faster. I froze regularized logistic regression with a 0.40 decision threshold, which gave 82.14% recall on validation data. In triage a false alarm only leads to a follow-up scan, while a missed case does not.
Final test results
| Metric | Result |
|---|---|
| Recall | 96.43% |
| Accuracy | 86.89% |
| Balanced accuracy | 87.61% |
| ROC-AUC | 0.9610 |

The model made 8 errors out of 61 patients: 7 false alarms and 1 missed case. The validation and test numbers agreed, which suggests the test set did not leak into the choices.
What I would do next
Test the model on data from other hospitals and more recent years, since this sample is small, single-center, and from 1988.