# sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction
- Repository: https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction

## Overview

This repository combines heart-disease data analysis and reporting with a Streamlit prediction app. The evidenced user workflow collects patient measurements, aligns and scales them, runs the saved classifier, and displays a risk prediction. The README also documents EDA, MySQL, and Power BI capabilities; their detailed wiring is not visible in the sampled source, so those links are left out.

Main entry points: [`app.py`](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py) (Prediction App), [`scaler.pkl`](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/scaler.pkl) (Feature Scaler), [`LOG_heart.pkl`](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/LOG_heart.pkl) (Heart Classifier), [`columns.pkl`](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/columns.pkl) (Feature Columns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prediction["Risk Prediction"]
  node_app["Prediction App<br/>[app.py]"]
  node_prep["Input Preparation<br/>[app.py]"]
  node_scaler["Feature Scaler<br/>[scaler.pkl]"]
  node_model["Heart Classifier<br/>[LOG_heart.pkl]"]
  node_columns["Feature Columns<br/>[columns.pkl]"]
  node_result["Risk Result<br/>[app.py]"]
end

subgraph group_analysis["Data Analysis"]
  node_dataset["Heart Dataset<br/>[heart.csv]"]
  node_eda["EDA Notebook"]
end

subgraph group_database["SQL Database"]
  node_mysql[("MySQL Database")]
  node_dbcreate["Database Setup"]
  node_table["Table Design<br/>[create_table.sql]"]
  node_views["SQL Views<br/>[create_views.sql]"]
  node_indexes["SQL Indexes<br/>[create_index.sql]"]
end

subgraph group_reporting["BI Reporting"]
  node_report["Power BI Report"]
end

node_user(("User"))

node_user -->|"enters measurements"| node_app
node_app -->|"loads columns"| node_columns
node_app -->|"loads scaler"| node_scaler
node_app -->|"loads classifier"| node_model
node_app -->|"builds input"| node_prep
node_prep -->|"aligns features"| node_columns
node_prep -->|"scales input"| node_scaler
node_prep -->|"predicts risk"| node_model
node_app -->|"displays prediction"| node_result
node_dbcreate -->|"creates database"| node_mysql
node_table -->|"defines table"| node_mysql
node_views -->|"creates views"| node_mysql
node_indexes -->|"adds indexes"| node_mysql

click node_app "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py"
click node_prep "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py"
click node_scaler "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/scaler.pkl"
click node_model "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/LOG_heart.pkl"
click node_columns "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/columns.pkl"
click node_result "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py"
click node_dataset "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/heart.csv"
click node_eda "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/ML_Project_02%20(EDA).ipynb"
click node_dbcreate "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_database.sql"
click node_table "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_table.sql"
click node_views "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_views.sql"
click node_indexes "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_index.sql"
click node_report "https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/Heart%20Disease%20BI%20Report.pbix"

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_app,node_prep,node_scaler,node_model,node_columns,node_result,node_user toneBlue
class node_dataset,node_eda toneAmber
class node_mysql,node_dbcreate,node_table,node_views,node_indexes toneMint
class node_report toneRose
```

## Components

### Risk Prediction

- [Prediction App](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py): `app.py`
- [Input Preparation](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py): `app.py`
- [Feature Scaler](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/scaler.pkl): `scaler.pkl`
- [Heart Classifier](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/LOG_heart.pkl): `LOG_heart.pkl`
- [Feature Columns](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/columns.pkl): `columns.pkl`
- [Risk Result](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/app.py): `app.py`

### Data Analysis

- [Heart Dataset](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/heart.csv): `heart.csv`
- [EDA Notebook](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/ML_Project_02%20(EDA).ipynb): `ML_Project_02 (EDA).ipynb`

### SQL Database

- **MySQL Database**
- [Database Setup](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_database.sql): `MySQL Queries/create_database.sql`
- [Table Design](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_table.sql): `MySQL Queries/create_table.sql`
- [SQL Views](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_views.sql): `MySQL Queries/create_views.sql`
- [SQL Indexes](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/MySQL%20Queries/create_index.sql): `MySQL Queries/create_index.sql`

### BI Reporting

- [Power BI Report](https://github.com/sahbimlesh007/end-to-end-heart-disease-analytics-and-prediction/blob/main/Heart%20Disease%20BI%20Report.pbix): `Heart Disease BI Report.pbix`

### Other components

- **User**

## Connections

- User → Prediction App: enters measurements
- Prediction App → Feature Columns: loads columns
- Prediction App → Feature Scaler: loads scaler
- Prediction App → Heart Classifier: loads classifier
- Prediction App → Input Preparation: builds input
- Input Preparation → Feature Columns: aligns features
- Input Preparation → Feature Scaler: scales input
- Input Preparation → Heart Classifier: predicts risk
- Prediction App → Risk Result: displays prediction
- Database Setup → MySQL Database: creates database
- Table Design → MySQL Database: defines table
- SQL Views → MySQL Database: creates views
- SQL Indexes → MySQL Database: adds indexes
