# anikesh20/diseases-prediction-system architecture

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

- Interactive diagram: https://gitdiagram.com/anikesh20/diseases-prediction-system
- Repository: https://github.com/anikesh20/diseases-prediction-system

## Overview

##### Main Components

a) Data Layer:
- Two primary datasets (diabetes.csv and heart.csv)
- A separate storage for user input data (Saved_data from user)

b) Model Training Layer:
- Training notebooks (diabetes.ipynb and heart.ipynb)
- Saved models directory (diabetes_model.sav and heart_disease_model.sav)

c) Application Layer:
- Streamlit web interface (app.py)
- Model inference pipeline

##### Data Flow
- Dataset → Training Notebooks → Saved Models
- User Input → Saved User Data
- Saved Models → Web Application

##### Process Flow
- How user interactions flow through the system
- How predictions are generated

- Blue: Data Storage Components
- Green: Processing Components
- Orange: User Interface
- Purple: Model Components

- Rectangles: Main components
- Rounded Rectangles: Processing units
- Hexagons: ML models

##### Specific Elements

a) Data Layer (Bottom):
**[Dataset]**
- diabetes.csv
- heart.csv

**[User Data Storage]**
- Saved_data from user

b) Model Layer (Middle):
**[Training Pipeline]**
- Training Notebooks
- Saved Models

**[Inference Pipeline]**
- Model Loading & Prediction

c) Application Layer (Top):
**[Streamlit Web Interface]**
- User Input Forms
- Prediction Display

##### Key Aspects to Emphasize

- Clear separation between training and inference paths
- Data persistence points
- Model versioning
- User interaction flows

##### Technical Details to Note

- Streamlit as the web framework
- Scikit-learn (implied by .sav files) for model training
- CSV-based data storage
- Python-based implementation

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Data_Storage
        DS1["Diabetes Dataset"]:::data
        DS2["Heart Disease Dataset"]:::data
        UD1["Diabetes User Data"]:::data
        UD2["Heart Disease User Data"]:::data
    end

    subgraph Model_Training
        MT1["Diabetes Training Notebook"]:::process
        MT2["Heart Disease Training Notebook"]:::process
    end

    subgraph Saved_Models
        SM1["Diabetes Model"]:::model
        SM2["Heart Disease Model"]:::model
    end

    subgraph Web_Application
        WA["Streamlit Interface"]:::ui
    end

    DS1 --> MT1
    DS2 --> MT2
    MT1 --> SM1
    MT2 --> SM2
    SM1 --> WA
    SM2 --> WA
    WA --> UD1
    WA --> UD2

    %% Click events for file/directory mapping
    click DS1 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/dataset/diabetes.csv"
    click DS2 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/dataset/heart.csv"
    click UD1 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/Saved_data from user/diabetes_data.csv"
    click UD2 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/Saved_data from user/heart_data.csv"
    click MT1 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/Training Models/diabetes.ipynb"
    click MT2 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/Training Models/heart.ipynb"
    click SM1 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/saved_models/diabetes_model.sav"
    click SM2 "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/saved_models/heart_disease_model.sav"
    click WA "https://github.com/Anikesh20/Diseases-Prediction-System/blob/main/app.py"

    %% Styling
    classDef data fill:#AEC6CF,stroke:#333,stroke-width:2px
    classDef process fill:#98FB98,stroke:#333,stroke-width:2px
    classDef model fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef ui fill:#FFB347,stroke:#333,stroke-width:2px

    %% Legend
    subgraph Legend
        L1["Data Storage"]:::data
        L2["Processing"]:::process
        L3["Models"]:::model
        L4["User Interface"]:::ui
    end
```
