# kanishka-rani-2005/multiple-disease-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/kanishka-rani-2005/multiple-disease-prediction
- Repository: https://github.com/kanishka-rani-2005/multiple-disease-prediction

## Overview

##### Project type and purpose
- This is a full-stack, single-page web application built with Streamlit.
- Its purpose is to collect user medical inputs for five diseases (Diabetes, Heart Disease, Parkinson’s, Breast Cancer, Lung Cancer) and return real-time predictions using pre-trained scikit-learn models.

##### File structure
- Top-level:
- main.py – the Streamlit entry point and controller
- requirements.txt – Python dependencies
- \*.sav and scaler\*.sav – serialized ML models and scalers
- Disease subdirectories (Breast-Prediction, Diabetes-Prediction, etc.) each contain:
- A Jupyter notebook for exploratory analysis/training
- Raw CSV data or serialized artifacts (e.g., .data, .sav files)
- No external database or microservices; everything is packaged in the app.

##### README for additional insights
- Confirms modular code structure for maintainability.
- Lists Tech Stack: Python, Streamlit, scikit-learn, pandas, numpy, matplotlib, streamlit-option-menu.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Client Browser"]:::frontend
    end

    %% Application Logic Layer
    subgraph "Application Logic Layer"
        direction TB
        Server["Streamlit Server (main.py)"]:::app
        Req["Dependency Specification (requirements.txt)"]:::app
        Form["Input Validation & Form Handler"]:::app
    end

    %% Pre-processing Layer
    subgraph "Pre-processing Layer"
        direction TB
        ScalerRoot["Root Scalers"]:::service
        ScalerLung["Lung Cancer Scaler"]:::service
    end

    %% Prediction Engine Layer
    subgraph "Prediction Engine" 
        direction TB
        DM["Diabetes Model"]:::ml
        HD["Heart Disease Model"]:::ml
        PM["Parkinson’s Model"]:::ml
        BC["Breast Cancer Model"]:::ml
        LC["Lung Cancer Model"]:::ml
    end

    %% Persistence Layer
    subgraph "Model Store"
        direction TB
        Store["Serialized .sav Files"]:::storage
    end

    %% Documentation Layer
    subgraph "Documentation & Data"
        direction TB
        NB1["Diabetes Notebook"]:::docs
        NB2["Heart Disease Notebook"]:::docs
        NB3["Parkinson’s Notebook"]:::docs
        NB4["Breast Cancer Notebook"]:::docs
        NB5["Lung Cancer Notebook"]:::docs
        Data1["diabetes.csv"]:::docs
        Data2["heart.csv"]:::docs
        Data3["parkinsons.data"]:::docs
        Data4["breast_cancer.csv"]:::docs
        Data5["survey lung cancer.csv"]:::docs
    end

    %% Connections
    Browser -->|"HTTP/WebSocket"| Server
    Server -->|"calls"| Form
    Form -->|"feature vector"| ScalerRoot
    ScalerRoot -->|"scaled data"| DM
    ScalerRoot -->|"scaled data"| HD
    ScalerRoot -->|"scaled data"| PM
    ScalerRoot -->|"scaled data"| BC
    ScalerLung -->|"scaled data"| LC
    DM -->|"load & predict"| Store
    HD -->|"load & predict"| Store
    PM -->|"load & predict"| Store
    BC -->|"load & predict"| Store
    LC -->|"load & predict"| Store
    DM -->|"prediction result"| Server
    HD -->|"prediction result"| Server
    PM -->|"prediction result"| Server
    BC -->|"prediction result"| Server
    LC -->|"prediction result"| Server
    Server -->|"renders output"| Browser

    %% Click Events
    click Server "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/main.py"
    click Req "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/requirements.txt"
    click ScalerRoot "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/scaler.sav"
    click ScalerRoot "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/scaler2.sav"
    click ScalerRoot "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/scaler3.sav"
    click ScalerRoot "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/scaler4.sav"
    click ScalerLung "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Lung_Cancer/scaler2.sav"
    click DM "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/diabetes_model.sav"
    click HD "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/heartdisease.sav"
    click PM "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/parkinsons_model.sav"
    click BC "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/breast_cancer.sav"
    click LC "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/lung_cancer.sav"
    click NB1 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Diabetes-Prediction/Diabetes_Prediction.ipynb"
    click NB2 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Heart-Disease/Heart_disease_prediction.ipynb"
    click NB3 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Parkinson_Disease/parkinsons_prediction.ipynb"
    click NB4 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Breast-Prediction/BreastCancer.ipynb"
    click NB5 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Lung_Cancer/lung_prediction.ipynb"
    click Data1 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Diabetes-Prediction/diabetes.csv"
    click Data2 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Heart-Disease/heart.csv"
    click Data3 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Parkinson_Disease/parkinsons.data"
    click Data4 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Breast-Prediction/breast_cancer.csv"
    click Data5 "https://github.com/kanishka-rani-2005/multiple-disease-prediction/blob/main/Lung_Cancer/survey lung cancer.csv"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#003366,stroke-width:2px;
    classDef app fill:#E6F4EA,stroke:#216E39,stroke-width:2px;
    classDef service fill:#FFF4D6,stroke:#996600,stroke-width:2px;
    classDef ml fill:#FFF0F0,stroke:#CC3333,stroke-width:2px;
    classDef storage fill:#F0F0F0,stroke:#666666,stroke-width:2px;
    classDef docs fill:#F9E6FF,stroke:#993399,stroke-width:2px;
```
