Skip to main content
Graduate coursework · BME 571 Machine Learning

Heart Disease Prediction with Logistic Regression

A 4-person comparative ML study on the UCI Heart Disease dataset. I owned the logistic regression model and the Introduction/Background section. The model reached a holdout ROC-AUC of 0.939, and its largest coefficients matched known clinical risk factors.

Role Logistic regression + Background (4-person team)
Timeline Jan – May 2026
Type Machine learning / Clinical data
Dataset UCI Heart Disease (Cleveland) · n = 303

Can a simple model reason like a clinician?

Can an interpretable model predict heart disease from a routine cardiology workup, and does it weigh the same factors a clinician would? We used the UCI Heart Disease dataset (Cleveland, 303 patients, 13 clinical features).

Each teammate built a different model on the same preprocessing so the results could be compared fairly. Mine was logistic regression, chosen because every coefficient can be read and checked.

Trade-off

Accuracy vs. explanation

Complex models can score well but can't say why. A clinician who has to defend a recommendation needs the why.

My piece

Logistic regression

Coefficients show exactly how much each feature pushes the prediction up or down.

Same data, same split, same metrics

Shared preprocessing. Median imputation and StandardScaler sit inside an sklearn Pipeline, so they are re-fit within each cross-validation fold and nothing leaks from test data into training.

One-hot encoding. Chest pain type, resting ECG, ST slope and thalassemia are categories, not ordered numbers. One-hot encoding them gave 18 model features in total.

Two kinds of evaluation. Stratified 5-fold cross-validation for a stable estimate, plus an 80/20 holdout split (seed 42) the model never trained on.

I pushed the team early to lock in the shared preprocessing and a common metrics format before anyone trained a model. Both were adopted.

Metric5-fold CV (mean ± SD)Holdout (n = 61)
ROC-AUC0.911 ± 0.0200.939
Accuracy0.848 ± 0.0300.820
Precision0.868 ± 0.0510.793
Recall0.821
F10.807
Python scikit-learn pandas matplotlib Jupyter Git/GitHub

The top coefficients match the clinical literature

FeatureCoefficientClinical meaning
ca (major vessels on fluoroscopy)+1.15Direct anatomical evidence of coronary disease
Asymptomatic chest pain+0.87In this dataset, mostly incidental findings during a workup
Male sex+0.74Non-modifiable cardiovascular risk factor
Reversible thalassemia defect+0.68Ischemic but viable heart muscle on imaging
Flat ST slope+0.60Classic ECG sign of ischemia during exercise
Max exercise heart rate−0.36Strongest protective factor: higher capacity, lower risk

These line up with the risk factors I wrote up in the report's Background section, which was the point of choosing a model you can read.

What I would add

01
Calibration.

ROC-AUC measures ranking, not whether a predicted 70% really means 70%. A calibration check is the next step for any model meant to inform a decision.

02
A clinical threshold.

A 0.5 cutoff is rarely right for screening, where a missed case costs more than an extra test. The operating point should be chosen on purpose.

03
Subgroups.

An overall AUC can hide a model that works well for one group and poorly for another. Breaking results out by age and sex would show that.

Interested in this work?

Interpretable ML on clinical data and fair comparisons between models. Happy to talk through the pipeline or the coefficients.