Back to the console

Heart Disease Prediction Model

CourseApplied AI, Mapúa UniversityDataUCI Heart Disease, 303 patientsMy roleBuilt the whole workflowToolsPython, pandas, scikit-learn

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

Choosing the model

Cross-validation on training data
ModelMean ROC-AUCFit time
Logistic regression0.8928 ± 0.04470.061 s
Random forest0.8865 ± 0.06320.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

Test set, 61 patients
MetricResult
Recall96.43%
Accuracy86.89%
Balanced accuracy87.61%
ROC-AUC0.9610
ROC curve of the one-time test run, AUC 0.96
ROC curve of the one-time test run, AUC 0.96.

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.

Next reportFlower Image Classifier