# jubayerrafin/heart-disease-ml architecture

> Architecture diagram of the GitHub repository jubayerrafin/heart-disease-ml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jubayerrafin/heart-disease-ml
- Repository: https://github.com/jubayerrafin/heart-disease-ml

## Overview

This repository is a notebook-based heart-disease screening classifier. Its documented workflow loads Cleveland patient data, removes incomplete rows and binarizes disease severity, then splits and scales the data before comparing KNN, Logistic Regression, and Random Forest. It tunes KNN and selects a cost-aware Random Forest threshold to prioritize recall, then reports screening metrics. The README supports these stages and relationships; the notebook itself was not sampled, so internal implementation details and any additional wiring are not asserted.

Main entry points: [`heart_disease.ipynb`](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb) (Analysis notebook), [`processed.cleveland.data`](https://github.com/jubayerrafin/heart-disease-ml/blob/main/processed.cleveland.data) (Cleveland data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_preparation["Data preparation"]
  node_patient_data["Cleveland data"]
  node_clean_target["Clean and label"]
  node_split_scale["Split and scale"]
end

subgraph group_modeling["Modeling"]
  node_model_compare["Compare models"]
  node_knn_tuning["Tune KNN"]
end

subgraph group_evaluation["Screening evaluation"]
  node_threshold["Tune threshold"]
  node_screen_metrics["Screening metrics"]
end

node_analyst(("Notebook user"))
node_notebook["Analysis notebook"]

node_analyst -->|"runs"| node_notebook
node_notebook -->|"reads"| node_patient_data
node_notebook -->|"prepares"| node_clean_target
node_patient_data -->|"provides rows"| node_clean_target
node_notebook -->|"splits and scales"| node_split_scale
node_clean_target -->|"provides labeled data"| node_split_scale
node_notebook -->|"compares"| node_model_compare
node_split_scale -->|"provides split data"| node_model_compare
node_notebook -->|"cross-validates"| node_knn_tuning
node_split_scale -->|"provides training data"| node_knn_tuning
node_notebook -->|"selects threshold"| node_threshold
node_model_compare -->|"provides Random Forest"| node_threshold
node_notebook -->|"evaluates"| node_screen_metrics
node_model_compare -->|"provides predictions"| node_screen_metrics
node_threshold -->|"provides decision rule"| node_screen_metrics

click node_notebook "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"
click node_patient_data "https://github.com/jubayerrafin/heart-disease-ml/blob/main/processed.cleveland.data"
click node_clean_target "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"
click node_split_scale "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"
click node_model_compare "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"
click node_knn_tuning "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"
click node_threshold "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"
click node_screen_metrics "https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_patient_data,node_clean_target,node_split_scale,node_analyst toneBlue
class node_model_compare,node_knn_tuning toneAmber
class node_threshold,node_screen_metrics toneMint
class node_notebook toneTeal
```

## Components

### Data preparation

- [Cleveland data](https://github.com/jubayerrafin/heart-disease-ml/blob/main/processed.cleveland.data): `processed.cleveland.data`
- [Clean and label](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`
- [Split and scale](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`

### Modeling

- [Compare models](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`
- [Tune KNN](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`

### Screening evaluation

- [Tune threshold](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`
- [Screening metrics](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`

### Other components

- **Notebook user**
- [Analysis notebook](https://github.com/jubayerrafin/heart-disease-ml/blob/main/heart_disease.ipynb): `heart_disease.ipynb`

## Connections

- Notebook user → Analysis notebook: runs
- Analysis notebook → Cleveland data: reads
- Analysis notebook → Clean and label: prepares
- Cleveland data → Clean and label: provides rows
- Analysis notebook → Split and scale: splits and scales
- Clean and label → Split and scale: provides labeled data
- Analysis notebook → Compare models: compares
- Split and scale → Compare models: provides split data
- Analysis notebook → Tune KNN: cross-validates
- Split and scale → Tune KNN: provides training data
- Analysis notebook → Tune threshold: selects threshold
- Compare models → Tune threshold: provides Random Forest
- Analysis notebook → Screening metrics: evaluates
- Compare models → Screening metrics: provides predictions
- Tune threshold → Screening metrics: provides decision rule
