# techstack-ujjwal/heart_disease_prediction_system architecture

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

- Interactive diagram: https://gitdiagram.com/techstack-ujjwal/heart_disease_prediction_system
- Repository: https://github.com/techstack-ujjwal/heart_disease_prediction_system

## Overview

This repository’s visible product is a Streamlit heart-disease risk prediction app. A user enters patient details, the app encodes them into model columns, scales numeric features, and runs a prediction; it then displays a risk category and probability with a medical disclaimer. The checked-in model and preprocessing artifacts are loaded by the app. The README provides no further capability details, and the notebook and dataset were not sampled, so their roles and connections are omitted.

Main entry points: [`app.py`](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py) (Feature Encoding), [`scaler.pkl`](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/scaler.pkl) (Feature Scaler), [`heart_disease_model.pkl`](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/heart_disease_model.pkl) (Trained Model), [`columns.pkl`](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/columns.pkl) (Expected Columns)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_form["Patient Input Form<br/>[app.py]"]
  node_result["Risk Result<br/>[app.py]"]
end

subgraph group_processing["Prediction Processing"]
  node_encoding["Feature Encoding<br/>[app.py]"]
  node_scaling["Numeric Scaling<br/>[app.py]"]
  node_inference["Risk Inference<br/>[app.py]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_scaler["Feature Scaler<br/>[scaler.pkl]"]
  node_model["Trained Model"]
  node_columns["Expected Columns<br/>[columns.pkl]"]
end

node_user(("User"))

node_user -->|"enters details"| node_form
node_form -->|"submits details"| node_encoding
node_encoding -->|"aligns columns"| node_columns
node_encoding -->|"passes features"| node_scaling
node_scaling -->|"transforms with"| node_scaler
node_scaling -->|"passes scaled data"| node_inference
node_inference -->|"predicts with"| node_model
node_inference -->|"displays prediction"| node_result

click node_form "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py"
click node_encoding "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py"
click node_scaling "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py"
click node_scaler "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/scaler.pkl"
click node_inference "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py"
click node_model "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/heart_disease_model.pkl"
click node_columns "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/columns.pkl"
click node_result "https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.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_form,node_result,node_user toneBlue
class node_encoding,node_scaling,node_inference toneAmber
class node_scaler,node_model,node_columns toneMint
```

## Components

### User Interface

- [Patient Input Form](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py): `app.py`
- [Risk Result](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py): `app.py`

### Prediction Processing

- [Feature Encoding](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py): `app.py`
- [Numeric Scaling](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py): `app.py`
- [Risk Inference](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/app.py): `app.py`

### Model Artifacts

- [Feature Scaler](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/scaler.pkl): `scaler.pkl`
- [Trained Model](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/heart_disease_model.pkl): `heart_disease_model.pkl`
- [Expected Columns](https://github.com/techstack-ujjwal/heart_disease_prediction_system/blob/main/columns.pkl): `columns.pkl`

### Other components

- **User**

## Connections

- User → Patient Input Form: enters details (evidence: `app.py`)
- Patient Input Form → Feature Encoding: submits details (evidence: `app.py`)
- Feature Encoding → Expected Columns: aligns columns (evidence: `app.py`)
- Feature Encoding → Numeric Scaling: passes features (evidence: `app.py`)
- Numeric Scaling → Feature Scaler: transforms with (evidence: `app.py`)
- Numeric Scaling → Risk Inference: passes scaled data (evidence: `app.py`)
- Risk Inference → Trained Model: predicts with (evidence: `app.py`)
- Risk Inference → Risk Result: displays prediction (evidence: `app.py`)
