DA 622 Course Project · Completed January–May 2026

When the “best” model depends on which error matters most.

Predicting Heart Disease Severity: A Machine Learning Analysis of the UCI Heart Disease Dataset

Course projectUCI Heart Disease Dataset

Dataset & models

920 raw records across four UCI source cohorts
Three-class severity target

Logistic regression
Random forest
Weighted XGBoost

Problem

Class imbalance can make severe cases easy to miss.

Why it matters analytically

A model can look strong in aggregate while performing poorly on the class of greatest interest. This project focuses on the tension between finding more severe cases and avoiding too many incorrect severe-case flags.

01

Model comparison

Three approaches, three different error profiles.

01

Logistic regression

Highest overall test accuracy (0.696), but severe-class recall was 0.333. Severe precision / recall / F1: 0.529 / 0.333 / 0.409.

Overall-accuracy lens
02

Tuned random forest

Highest severe-class F1 in this comparison. Severe precision / recall / F1: 0.375 / 0.667 / 0.480.

Highest severe F1
03

Weighted XGBoost

Highest severe-class recall, with the lowest severe precision. Severe precision / recall / F1: 0.339 / 0.741 / 0.465.

Highest severe recall
02

Evaluation design

Move past a single overall score.

The comparison reads class-specific performance alongside aggregate results so the severe class does not disappear inside a majority-class average.

Severe-class recall

Of the severe cases, how many did the model identify?

Higher recall means fewer severe cases were missed.

Severe-class precision

Of the cases flagged as severe, how many were severe?

Higher precision means fewer non-severe cases were incorrectly flagged as severe.

Model selection

Which error is more costly in the intended use?

The project does not answer this with a universal winner; it exposes the choice.

My contribution

Build, compare, and interpret the severity models.

The course project covers data preparation, class-imbalance handling, training the three compared approaches, and reading the resulting class-specific tradeoffs.

Interpretation

The metric follows the question.

If missed severe cases dominate the decision, recall deserves more weight. If incorrect severe flags carry a high cost, precision becomes more important. The analysis is strongest when that choice is stated plainly.

Repository & report

A completed course analysis, with a deliberately bounded claim.

This project demonstrates model comparison under class imbalance. It is not presented as clinical research, clinical validation, or a patient-care system.

Related research direction. The comparison contributes to my broader interest in careful model evaluation and explainable health-data analysis.