# aditya-mankar/diabetes-prediction architecture

> Architecture diagram of the GitHub repository aditya-mankar/diabetes-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aditya-mankar/diabetes-prediction
- Repository: https://github.com/aditya-mankar/diabetes-prediction

## Overview

This is a diabetes-classification project with a model-development workflow and a Flask prediction interface. Training reads the diabetes data, preprocesses selected features, fits and evaluates a classifier, and saves a pickle; the Flask app loads that artifact and accepts patient inputs for prediction and a rendered result. The README also describes comparing algorithms, though the shown model source only demonstrates an SVC evaluation. The template and CSV contents were not sampled, so their details are not inferred here.

Main entry points: [`flask/app.py`](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/app.py) (Flask Routes and Prediction), [`flask/model.py`](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.py) (Preprocessing and Training), [`flask/model.pkl`](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.pkl) (Trained Model), [`flask/templates/index.html`](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/templates/index.html) (Prediction Form and Result)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Patient Data"]
  node_training_data[("Diabetes Dataset<br/>[diabetes.csv]")]
end

subgraph group_modeling["Model Development"]
  node_training["Preprocessing and Training<br/>[model.py]"]
  node_evaluation["Model Evaluation<br/>[model.py]"]
  node_artifact[("Trained Model<br/>[model.pkl]")]
end

subgraph group_web["Prediction App"]
  node_app_data[("Prediction Dataset<br/>[diabetes.csv]")]
  node_app["Flask Routes and Prediction<br/>[app.py]"]
end

subgraph group_presentation["Web Presentation"]
  node_template["Prediction Form and Result<br/>[index.html]"]
  node_styles["Page Styles<br/>[style.css]"]
end

node_user(("Patient / User"))

node_training -->|"reads data"| node_training_data
node_training -->|"fits and evaluates"| node_evaluation
node_training -->|"saves model"| node_artifact
node_app -->|"loads model"| node_artifact
node_app -->|"reads data"| node_app_data
node_app -->|"predicts with"| node_artifact
node_user -->|"submits inputs"| node_app
node_app -->|"renders page"| node_template
node_template -.->|"uses styles"| node_styles
node_app -->|"returns result"| node_user

click node_training_data "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/diabetes.csv"
click node_training "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.py"
click node_evaluation "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.py"
click node_artifact "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.pkl"
click node_app_data "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/diabetes.csv"
click node_app "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/app.py"
click node_template "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/templates/index.html"
click node_styles "https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/static/css/style.css"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_training_data,node_user toneBlue
class node_training,node_evaluation,node_artifact toneAmber
class node_app_data,node_app toneMint
class node_template,node_styles toneRose
```

## Components

### Patient Data

- [Diabetes Dataset](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/diabetes.csv): `flask/diabetes.csv`

### Model Development

- [Preprocessing and Training](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.py): `flask/model.py`
- [Model Evaluation](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.py): `flask/model.py`
- [Trained Model](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/model.pkl): `flask/model.pkl`

### Prediction App

- [Prediction Dataset](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/diabetes.csv): `flask/diabetes.csv`
- [Flask Routes and Prediction](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/app.py): `flask/app.py`

### Web Presentation

- [Prediction Form and Result](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/templates/index.html): `flask/templates/index.html`
- [Page Styles](https://github.com/aditya-mankar/diabetes-prediction/blob/master/flask/static/css/style.css): `flask/static/css/style.css`

### Other components

- **Patient / User**

## Connections

- Preprocessing and Training → Diabetes Dataset: reads data (evidence: `flask/model.py`)
- Preprocessing and Training → Model Evaluation: fits and evaluates (evidence: `flask/model.py`)
- Preprocessing and Training → Trained Model: saves model (evidence: `flask/model.py`)
- Flask Routes and Prediction → Trained Model: loads model (evidence: `flask/app.py`)
- Flask Routes and Prediction → Prediction Dataset: reads data (evidence: `flask/app.py`)
- Flask Routes and Prediction → Trained Model: predicts with (evidence: `flask/app.py`)
- Patient / User → Flask Routes and Prediction: submits inputs (evidence: `flask/app.py`)
- Flask Routes and Prediction → Prediction Form and Result: renders page (evidence: `flask/app.py`)
- Prediction Form and Result → Page Styles: uses styles
- Flask Routes and Prediction → Patient / User: returns result (evidence: `flask/app.py`)
