# srudeep47/heart-disease-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/srudeep47/heart-disease-prediction
- Repository: https://github.com/srudeep47/heart-disease-prediction

## Overview

##### Main Components
- User Interface (Frontend): Built with Streamlit. Represent this as the web UI component.
- Backend/Processing Logic: The core logic inside web.py that processes user inputs, sends them to the machine learning model, and returns predictions.
- Machine Learning Model: The trained Logistic Regression model stored as "trained_model.sav" (loaded via Pickle).
- Data Processing: Supporting libraries such as NumPy that handle numerical computations.
- Environment/Containerization: The .devcontainer folder indicates that the project is set up for a containerized development environment.

##### Relationships and Data Flow
- Dependencies on the external libraries (NumPy and Pickle) connected to the processing module.

##### Architectural Patterns and Design Components
- Use the Model-View style where the Streamlit interface represents the view and web.py acts as both controller and some backend processing.
- Separation of concerns: UI handling via Streamlit, business logic handling in web.py, and data/model handling via the trained model.

##### Relevant Technologies
- Python as the core programming language.
- Streamlit for the web interface.
- NumPy for data processing.
- Pickle (and the saved logistic regression model) for ML predictions.
- The .devcontainer configuration for development environment consistency.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Development Environment (.devcontainer)"
        CONTAINER["Development Environment (.devcontainer)"]:::container
        UI["Heart Disease Prediction Web Interface"]:::ui
        AL["Application Logic (web.py)"]:::backend
        ML["Trained ML Model (trained_model.sav)"]:::model
    end
    DP["Data Processing (NumPy,Pickle)"]:::dataproc

    UI -->|"inputData"| AL
    AL -->|"loadModel"| ML
    ML -->|"prediction"| AL
    AL -->|"result"| UI
    AL -->|"usesLibrary"| DP

    click UI "https://github.com/srudeep47/heart-disease-prediction/blob/main/web.py"
    click AL "https://github.com/srudeep47/heart-disease-prediction/blob/main/web.py"
    click ML "https://github.com/srudeep47/heart-disease-prediction/blob/main/trained_model.sav"
    click CONTAINER "https://github.com/srudeep47/heart-disease-prediction/blob/main/.devcontainer"

    classDef ui fill:#AED6F1,stroke:#1F618D,stroke-width:2px;
    classDef backend fill:#F9E79F,stroke:#B7950B,stroke-width:2px;
    classDef model fill:#A9DFBF,stroke:#1E8449,stroke-width:2px;
    classDef container fill:#F5B7B1,stroke:#943126,stroke-width:2px,stroke-dasharray:5,5;
    classDef dataproc fill:#D2B4DE,stroke:#6C3483,stroke-width:2px;
```
