# srjbishtji/multiple_disease_prediction_system architecture

> Architecture diagram of the GitHub repository srjbishtji/multiple_disease_prediction_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/srjbishtji/multiple_disease_prediction_system
- Repository: https://github.com/srjbishtji/multiple_disease_prediction_system

## Overview

##### Project Purpose and Type
- The project is a machine learning-based prediction system that focuses on diagnosing multiple diseases (Diabetes, Heart Disease, and Parkinson’s Disease) using pre-trained models.
- The presence of several Jupyter notebooks (one per disease), CSV data files, model files (.sav), and a main Python script indicates that this is an ML-driven system with a simple, possibly Streamlit–based, front-end to display predictions.

##### Analyzing the File Structure
- The project is organized as a flat structure without deep directory hierarchies. This indicates a relatively small or prototype-level codebase.
- Key components identifiable from the file tree:
- Jupyter Notebooks: Diabetes_Prediction.ipynb, Heart_Disease_Prediction.ipynb, and Parkinson's_Disease_Detection.ipynb. These likely serve for experimenting with or demonstrating the predictions.
- Data Files: diabetes.csv, heart.csv, parkinsons.csv, which may be used for training, evaluation, or showcasing example data.
- Pre-trained Model Files: diabetes_model.sav, heart_disease_model.sav, parkinsons_model.sav – these encapsulate the predictive logic for the respective diseases.
- The main application script: multiple_disease_prediction_systems.py, which likely encapsulates the logic for handling user input, loading the saved models, and integrating with the UI.
- requirements.txt: Lists dependencies, underscoring the technical stack (probably including libraries such as pandas, scikit-learn, and streamlit).

##### Interpreting the README
- The README is minimal but confirms the project name and even provides a deployment URL for a Streamlit app. This tells us that the application is intended to be deployed as a web app where users can interactively get predictions.
- Although there isn’t an explicit architecture section in the README, the URL and file names confirm that the Streamlit-based UI is the main interface.

a. Main Components:
- User Interface: The Streamlit front-end which the users interact with.
- Controller/Application Logic: The multiple_disease_prediction_systems.py script that orchestrates user inputs, routes to appropriate prediction functions, and handles interactions.
- Machine Learning Prediction Modules: Separate models for each disease (diabetes_model.sav, heart_disease_model.sav, parkinsons_model.sav) that are loaded and used for predictions.
- Data Files: CSV files for each disease which could be used either as sample input data or for model evaluation.
- Notebooks: Serve as additional demonstration or development documentation for each prediction path.

b. Relationships and Interactions:
- The user interacts with the Streamlit UI, which passes data to the application logic.
- The application logic then selects the appropriate ML model based on the disease prediction selected.
- Each ML model (loaded from its corresponding .sav file) takes in processed input (which may have been cleaned and structured using logic possibly illustrated in the notebooks) and returns a prediction.
- Optionally, data flow can also include reference to the CSV files for demonstration purposes or backend hard-coded sample data.

c. Architectural Patterns:
- Separation of Concerns: Clear division between the UI (Streamlit), application logic (multiple_disease_prediction_systems.py), and the ML prediction modules.
- Pipeline Flow: Input acquisition → Processing → Model Inference → Output Display.
- Modularity: Each disease prediction is modularized into its own model file and potentially its own notebook, which can be visualized as independent components that plug into a centralized orchestration layer.

d. Relevant Technologies and Libraries:
- Python is the central language.
- Streamlit is used for the front-end web app UI.
- Machine Learning libraries (for example, scikit-learn) were likely used to create and save the .sav model files.
- Data manipulation tools (pandas or similar) are probably used to handle CSV files.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        UI["Streamlit UI"]:::ui
    end

    %% Backend/Application Logic
    subgraph "Backend Layer"
        Logic["Application Logic (multiple_disease_prediction_systems.py)"]:::logic
    end

    %% Machine Learning Prediction Modules
    subgraph "ML Prediction Modules"
        %% Diabetes Module
        subgraph "Diabetes Module"
            DNB["Diabetes Notebook (Diabetes_Prediction.ipynb)"]:::module
            DM["Diabetes Model (diabetes_model.sav)"]:::module
        end
        %% Heart Disease Module
        subgraph "Heart Disease Module"
            HNB["Heart Disease Notebook (Heart_Disease_Prediction.ipynb)"]:::module
            HM["Heart Disease Model (heart_disease_model.sav)"]:::module
        end
        %% Parkinson’s Disease Module
        subgraph "Parkinson’s Module"
            PNB["Parkinson's Disease Notebook (Parkinson's_Disease_Detection.ipynb)"]:::module
            PM["Parkinson's Disease Model (parkinsons_model.sav)"]:::module
        end
    end

    %% Data Files
    subgraph "Data Files"
        DCSV["diabetes.csv"]:::data
        HCSV["heart.csv"]:::data
        PCSV["parkinsons.csv"]:::data
    end

    %% Other Resources
    subgraph "Other Resources"
        Dep["Dependencies & Setup (requirements.txt)"]:::resource
        Doc["Project Documentation (README.md)"]:::resource
    end

    %% Data Flow
    UI -->|"user_input"| Logic
    Logic -->|"selects_prediction"| DM
    Logic -->|"selects_prediction"| HM
    Logic -->|"selects_prediction"| PM
    DM -->|"prediction"| UI
    HM -->|"prediction"| UI
    PM -->|"prediction"| UI

    %% Reference to Notebooks for development insights
    Logic -->|"references"| DNB
    Logic -->|"references"| HNB
    Logic -->|"references"| PNB

    %% Data Files integration with ML Modules
    DCSV ---|"sample_data"| DM
    HCSV ---|"sample_data"| HM
    PCSV ---|"sample_data"| PM

    %% Styles
    classDef ui fill:#f9c,stroke:#333,stroke-width:2px;
    classDef logic fill:#ccf,stroke:#333,stroke-width:2px;
    classDef module fill:#cfc,stroke:#333,stroke-width:2px;
    classDef data fill:#ffc,stroke:#333,stroke-width:2px;
    classDef resource fill:#fcc,stroke:#333,stroke-width:2px;

    %% Click Events
    click UI "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/multiple_disease_prediction_systems.py"
    click DNB "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/Diabetes_Prediction.ipynb"
    click DM "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/diabetes_model.sav"
    click HNB "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/Heart_Disease_Prediction.ipynb"
    click HM "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/heart_disease_model.sav"
    click PNB "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/Parkinson's_Disease_Detection.ipynb"
    click PM "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/parkinsons_model.sav"
    click DCSV "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/diabetes.csv"
    click HCSV "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/heart.csv"
    click PCSV "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/parkinsons.csv"
    click Dep "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/requirements.txt"
    click Doc "https://github.com/srjbishtji/multiple_disease_prediction_system/blob/main/README.md"
```
