# debmalyapal/disease-prediction-system-using-machine-learning architecture

> Architecture diagram of the GitHub repository debmalyapal/disease-prediction-system-using-machine-learning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-11-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/debmalyapal/disease-prediction-system-using-machine-learning
- Repository: https://github.com/debmalyapal/disease-prediction-system-using-machine-learning

## Overview

##### Project type and purpose
- This is a backend-only machine learning service named “Disease-Prediction-System-using-Machine-Learning.”
- It includes a data folder, a Jupyter notebook for training, a Python Flask application (app.py), and dependency specifications.
- Purpose: train a disease-prediction model on CSV data and expose a REST API for inference.

##### File structure
- Top-level files:
- Algorithm.txt – likely algorithm description or pseudocode
- CS_8thSem_80.pptx – project presentation
- README.md – project title
- Backend/ directory:
- Data/Testing.csv & Training.csv – labeled datasets for model training and test
- -80  Machine Learning Code.ipynb – notebook with data preprocessing, feature engineering, model training
- app.py – Flask web service loading the trained model and serving prediction endpoints
- requirements.txt – Python dependencies (Flask, pandas, scikit-learn, etc.)
- .flaskenv-sample, .gitignore – environment setup and version control ignores

##### README for additional insights
- The README only provides the project title, so infer architecture from code and file names.
- The core components are: data ingestion & preprocessing, model training, model artifact storage, and inference API.

##### Diagramming the architecture
a. Main components:
1. Data Store
– Training Data (Training.csv)
– Test Data (Testing.csv)
2. Training Pipeline
– Jupyter Notebook or training script
– Data preprocessing, feature engineering, model fitting
– Model artifact (e.g., model.pkl or saved model file)
3. Model Repository
– Store serialized model files
4. Inference Service (Flask API)
– app.py loads model at startup
– Exposes /predict endpoint
5. Client or UI (external)
– Could be CLI, Postman, or a web front-end (not in repo)
6. (Optional) Logging/Monitoring
– Log requests and predictions to file or external monitoring service

b. Relationships & interactions:
1. Training Pipeline reads Data Store → produces Model Artifact → pushes to Model Repository
2. Inference Service loads Model Artifact from Model Repository at startup
3. Client sends HTTP request to Inference Service → receives JSON prediction
4. Inference Service may log each request to a logfile or monitoring endpoint

c. Architectural patterns & principles:
– Separation of concerns: training vs. inference
– Stateless API design: each prediction request is independent
– Single responsibility: app.py only handles inference, not training
– Use of environment isolation: requirements.txt and .flaskenv to manage dependencies

d. Key technologies & frameworks:
– Python 3.x
– pandas, numpy for data handling
– scikit-learn (or similar) for ML algorithms
– Jupyter Notebook for exploration/training
– Flask for web API
– CSV files as simple data store

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Offline Training Workflow
    subgraph "Offline Training Workflow"
        DataTrain["Training Data (Training.csv)"]:::storage
        DataTest["Test Data (Testing.csv)"]:::storage
        Notebook["Training Notebook"]:::compute
        ModelArtifact["Model Artifact (.pkl)"]:::storage
        DataTrain -->|"CSV data"| Notebook
        DataTest -->|"CSV data"| Notebook
        Notebook -->|"model.pkl"| ModelArtifact
    end

    %% Online Inference Workflow
    subgraph "Online Inference Workflow"
        API["Flask API (/predict)"]:::compute
        Client["Client (Postman/CLI)"]:::external
        ModelArtifact -->|"Loads model"| API
        Client -->|"HTTP POST /predict"| API
        API -->|"JSON prediction"| Client
    end

    %% Project Artifacts and Configurations
    subgraph "Project Artifacts"
        Algo["Algorithm.txt"]:::external
        PPT["CS_8thSem_80.pptx"]:::external
        Readme["README.md"]:::external
        Req["requirements.txt"]:::config
        Env[".flaskenv-sample"]:::config
        Gitignore[".gitignore"]:::config
    end

    %% Configuration Dependencies
    Req --> Notebook
    Req --> API
    Env --> API

    %% Click Events
    click DataTrain "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/Data/Training.csv"
    click DataTest "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/Data/Testing.csv"
    click Notebook "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/GROUP-80  Machine Learning Code.ipynb"
    click API "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/app.py"
    click Req "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/requirements.txt"
    click Env "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/.flaskenv-sample"
    click Gitignore "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Backend/.gitignore"
    click Algo "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/Algorithm.txt"
    click PPT "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/CS_8thSem_80.pptx"
    click Readme "https://github.com/debmalyapal/disease-prediction-system-using-machine-learning/blob/main/README.md"

    %% Styles
    classDef storage fill:#D0E6FF,stroke:#004C99,color:#004C99;
    classDef compute fill:#DFF2D8,stroke:#2E7D32,color:#2E7D32;
    classDef external fill:#FFE5B4,stroke:#CC8400,color:#CC8400;
    classDef config fill:#F0F0F0,stroke:#888888,color:#555555;
```
