# mihirj2002/heartdisease_machineleaning_model architecture

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

- Interactive diagram: https://gitdiagram.com/mihirj2002/heartdisease_machineleaning_model
- Repository: https://github.com/mihirj2002/heartdisease_machineleaning_model

## Overview

This repository is a heart-disease classification workflow: it loads patient data, prepares features, trains a classifier, and reports evaluation metrics. The sampled code shows a Random Forest implementation in `src/model_building.py`; although the README describes exploratory analysis and AutoGluon, those implementations are not present in the sampled source, so they are not represented as runtime components. The loader reads from a remote CSV URL, while a CSV also exists in the repository; whether the local file is used is unclear.

Main entry points: [`main.py`](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/main.py) (Pipeline entry), [`src/data_preprocessing.py`](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py) (Preprocess features), [`src/data_ingestion.py`](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_ingestion.py) (Data ingestion), [`src/model_building.py`](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/model_building.py) (Random Forest)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Workflow entry"]
  node_main["Pipeline entry<br/>[main.py]"]
end

subgraph group_preparation["Data preparation"]
  node_ingestion["Data ingestion<br/>[data_ingestion.py]"]
  node_preprocessing["Preprocess features"]
  node_split["Train-test split"]
  node_scaling["Feature scaling"]
  node_smote["Class balancing"]
end

subgraph group_modeling["Modeling"]
  node_model["Random Forest<br/>[model_building.py]"]
  node_evaluation["Model evaluation<br/>[model_building.py]"]
end

node_user(("Workflow invoker"))
node_remote_csv["Remote CSV"]
node_dataset["Heart dataset"]

node_user -->|"invokes"| node_main
node_main -->|"calls"| node_ingestion
node_remote_csv -->|"provides data"| node_ingestion
node_ingestion -->|"returns data"| node_main
node_main -->|"calls"| node_preprocessing
node_preprocessing -->|"separates features"| node_split
node_split -->|"scales sets"| node_scaling
node_scaling -->|"balances training"| node_smote
node_preprocessing -->|"returns sets"| node_main
node_main -->|"calls"| node_model
node_model -->|"predicts and scores"| node_evaluation
node_evaluation -->|"prints metrics"| node_main

click node_main "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/main.py"
click node_ingestion "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_ingestion.py"
click node_dataset "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/data/heart_disease_risk_2026.csv"
click node_preprocessing "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py"
click node_split "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py"
click node_scaling "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py"
click node_smote "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py"
click node_model "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/model_building.py"
click node_evaluation "https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/model_building.py"

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_main toneBlue
class node_ingestion,node_preprocessing,node_split,node_scaling,node_smote toneAmber
class node_model,node_evaluation toneMint
class node_user,node_remote_csv toneIndigo
class node_dataset toneTeal
```

## Components

### Workflow entry

- [Pipeline entry](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/main.py): `main.py`

### Data preparation

- [Data ingestion](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_ingestion.py): `src/data_ingestion.py`
- [Preprocess features](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Train-test split](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Feature scaling](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`
- [Class balancing](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/data_preprocessing.py): `src/data_preprocessing.py`

### Modeling

- [Random Forest](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/model_building.py): `src/model_building.py`
- [Model evaluation](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/src/model_building.py): `src/model_building.py`

### Other components

- **Workflow invoker**
- **Remote CSV**
- [Heart dataset](https://github.com/mihirj2002/heartdisease_machineleaning_model/blob/main/data/heart_disease_risk_2026.csv): `data/heart_disease_risk_2026.csv`

## Connections

- Workflow invoker → Pipeline entry: invokes
- Pipeline entry → Data ingestion: calls
- Remote CSV → Data ingestion: provides data
- Data ingestion → Pipeline entry: returns data
- Pipeline entry → Preprocess features: calls
- Preprocess features → Train-test split: separates features
- Train-test split → Feature scaling: scales sets
- Feature scaling → Class balancing: balances training
- Preprocess features → Pipeline entry: returns sets
- Pipeline entry → Random Forest: calls
- Random Forest → Model evaluation: predicts and scores
- Model evaluation → Pipeline entry: prints metrics
