A small, production-style ML project that predicts heart disease using the UCI Heart Disease dataset. Includes a reproducible pipeline, threshold tuning on a validation set, model comparison, PR curve summaries, and a final aggregated report.
This repo uses uv for fast, pinned installs.
-
Install
uv(once): https://docs.astral.sh/uv/ -
Then run:
uv sync --dev
This runs checks + trains models + generates reports:
make report-e2e VAL_BEST_METRIC=f1
For a quick, read-only demo path without committing generated reports:
docs/results_snapshot.mdreports/model_card.md- Latest Release (download the
reports_bundle_<tag>.zipasset):../../releases/latest
All outputs are written to reports/. The main entry point is:
reports/final_report.md(aggregates everything)
Also included:
reports/model_comparison.md(baseline vs RF vs HGB at each model’s val-tuned threshold)reports/*val_tuning_report.md(chosen threshold on val + resulting test metrics)reports/pr_curve_*.mdandreports/pr_curve_*.csv(Precision–Recall summaries + curve data)reports/*.json(machine-readable metrics)reports/predictions_*.csv(predictions for val/test runs)
- The model outputs probabilities.
- We select the best classification threshold on the validation set based on
VAL_BEST_METRIC(default:f1). - We then report metrics on the test set at that chosen threshold.
- PR curves are generated to summarize the precision/recall tradeoff.
make check— format/lint/typecheck/testsmake data— download datasetmake preprocess— build processed datasetmake split— train/val/test splitmake train-baseline/make train-rf/make train-hgb— train models + write metric reportsmake final-report-print VAL_BEST_METRIC=f1— generate final reportmake pr-curves-print VAL_BEST_METRIC=f1— generate PR summariesmake report-e2e VAL_BEST_METRIC=f1— one-command end-to-end “value step”
GitHub Actions runs the same value step:
make report-e2e VAL_BEST_METRIC=f1
It also uploads the reports/ outputs as an artifact (even if the job fails),
so you can download final_report.md and related files directly from the workflow run.
- This is a small dataset; metrics can vary with random seeds/splits.
- This repo emphasizes clean workflow + reproducibility over state-of-the-art modeling.
MIT