# miteshpanda/heartsense architecture

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

- Interactive diagram: https://gitdiagram.com/miteshpanda/heartsense
- Repository: https://github.com/miteshpanda/heartsense

## Overview

HeartSense presents a healthcare risk dashboard with dataset overview, model insights, and patient prediction. The inspected dashboard implements local scikit-learn training and inference, despite the README describing a separate PySpark training pipeline. The PySpark stages and evaluator are retained as documented capabilities, but their implementation and connection to the dashboard could not be verified from the sampled source. Dashboard responsibilities share one source file; arrows reflect its visible calls and data use.

Main entry points: [`heart_disease_dashboard.py`](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py) (Dash Interface), [`logisticregressionpyspark.txt`](https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt) (Spark Logistic Model), [`heart_disease_dataset.csv`](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dataset.csv) (Heart Dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Clinical Data"]
  node_dataset[("Heart Dataset")]
  node_load["Load Dataset"]
end

subgraph group_training["Model Pipeline"]
  node_features["Clinical Features"]
  node_scaling["Feature Scaling"]
  node_localmodel["Local Classifier"]
  node_sparkprep["Spark Preparation"]
  node_sparkmodel["Spark Logistic Model"]
  node_evaluation["Model Evaluation"]
end

subgraph group_dashboard["Dashboard Experience"]
  node_importance["Feature Importance"]
  node_correlation["Correlation Heatmap"]
  node_overview["Dataset Overview"]
  node_prediction["Risk Prediction"]
  node_dash["Dash Interface"]
end

node_user(("Dashboard User"))

node_load -->|"reads CSV"| node_dataset
node_load -->|"selects columns"| node_features
node_features -->|"transforms features"| node_scaling
node_scaling -->|"fits classifier"| node_localmodel
node_load -->|"provides statistics"| node_overview
node_load -->|"provides correlations"| node_correlation
node_importance -->|"renders chart"| node_dash
node_correlation -->|"renders chart"| node_dash
node_overview -->|"renders summary"| node_dash
node_user -->|"uses dashboard"| node_dash
node_dash -->|"collects inputs"| node_prediction
node_prediction -->|"scales input"| node_scaling
node_prediction -->|"requests probability"| node_localmodel
node_sparkprep -->|"assembles features"| node_sparkmodel
node_sparkmodel -->|"evaluates model"| node_evaluation

click node_dataset "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dataset.csv"
click node_load "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_features "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_scaling "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_localmodel "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_sparkprep "https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt"
click node_sparkmodel "https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt"
click node_evaluation "https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt"
click node_importance "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_correlation "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_overview "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_prediction "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py"
click node_dash "https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.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_dataset,node_load,node_user toneBlue
class node_features,node_scaling,node_localmodel,node_sparkprep,node_sparkmodel,node_evaluation toneAmber
class node_importance,node_correlation,node_overview,node_prediction,node_dash toneMint
```

## Components

### Clinical Data

- [Heart Dataset](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dataset.csv): `heart_disease_dataset.csv`
- [Load Dataset](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`

### Model Pipeline

- [Clinical Features](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Feature Scaling](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Local Classifier](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Spark Preparation](https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt): `logisticregressionpyspark.txt`
- [Spark Logistic Model](https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt): `logisticregressionpyspark.txt`
- [Model Evaluation](https://github.com/miteshpanda/heartsense/blob/main/logisticregressionpyspark.txt): `logisticregressionpyspark.txt`

### Dashboard Experience

- [Feature Importance](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Correlation Heatmap](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Dataset Overview](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Risk Prediction](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`
- [Dash Interface](https://github.com/miteshpanda/heartsense/blob/main/heart_disease_dashboard.py): `heart_disease_dashboard.py`

### Other components

- **Dashboard User**

## Connections

- Load Dataset → Heart Dataset: reads CSV (evidence: `heart_disease_dashboard.py`)
- Load Dataset → Clinical Features: selects columns (evidence: `heart_disease_dashboard.py`)
- Clinical Features → Feature Scaling: transforms features (evidence: `heart_disease_dashboard.py`)
- Feature Scaling → Local Classifier: fits classifier (evidence: `heart_disease_dashboard.py`)
- Load Dataset → Dataset Overview: provides statistics (evidence: `heart_disease_dashboard.py`)
- Load Dataset → Correlation Heatmap: provides correlations (evidence: `heart_disease_dashboard.py`)
- Feature Importance → Dash Interface: renders chart (evidence: `heart_disease_dashboard.py`)
- Correlation Heatmap → Dash Interface: renders chart (evidence: `heart_disease_dashboard.py`)
- Dataset Overview → Dash Interface: renders summary (evidence: `heart_disease_dashboard.py`)
- Dashboard User → Dash Interface: uses dashboard (evidence: `README.md`)
- Dash Interface → Risk Prediction: collects inputs (evidence: `heart_disease_dashboard.py`)
- Risk Prediction → Feature Scaling: scales input (evidence: `heart_disease_dashboard.py`)
- Risk Prediction → Local Classifier: requests probability (evidence: `heart_disease_dashboard.py`)
- Spark Preparation → Spark Logistic Model: assembles features (evidence: `README.md`)
- Spark Logistic Model → Model Evaluation: evaluates model (evidence: `README.md`)
