# hemanth-karumanchi/daibetes_predictor_app architecture

> Architecture diagram of the GitHub repository hemanth-karumanchi/daibetes_predictor_app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hemanth-karumanchi/daibetes_predictor_app
- Repository: https://github.com/hemanth-karumanchi/daibetes_predictor_app

## Overview

Diabetes Predictor combines an offline training and evaluation workflow with a Streamlit prediction interface. Training reads the Pima dataset, creates feature and label sets, splits the data, fits logistic regression, reports metrics, and invokes visualizations. The app accepts eight measurements, loads a serialized model, predicts a binary outcome, and displays confidence. The source shows training saves to the repository-root model file, while the app loads a separate file under model/. Their relationship is therefore not assumed. Training details also follow the README; unsampled artifact contents were not inspected.

Main entry points: [`main.py`](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py) (Training Workflow), [`app.py`](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py) (Prediction & Confidence), [`Diabetes Data/diabetes.csv`](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/Diabetes%20Data/diabetes.csv) (Pima Dataset), [`model/diabetes_model.pkl`](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/model/diabetes_model.pkl) (Loaded Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model Training"]
  node_dataset[("Pima Dataset<br/>[diabetes.csv]")]
  node_train["Training Workflow<br/>[main.py]"]
  node_features["Feature / Label Split<br/>[main.py]"]
  node_split["Train-Test Split<br/>[main.py]"]
  node_classifier["Logistic Regression<br/>[main.py]"]
  node_trained_model["Training Artifact<br/>[diabetes_model.pkl]"]
end

subgraph group_analysis["Evaluation &amp; Visuals"]
  node_evaluation["Metrics &amp; Predictions<br/>[main.py]"]
  node_visuals["Plot Functions<br/>[visuals.py]"]
end

subgraph group_prediction["Prediction App"]
  node_input_form["Measurement Inputs<br/>[app.py]"]
  node_app_model["Loaded Model<br/>[diabetes_model.pkl]"]
  node_predict["Prediction &amp; Confidence<br/>[app.py]"]
  node_result["Displayed Result<br/>[app.py]"]
end

node_app_user(("App User"))

node_dataset -->|"read by"| node_train
node_train -->|"prepares"| node_features
node_features -->|"provides data"| node_split
node_train -->|"splits data"| node_split
node_train -->|"fits model"| node_classifier
node_train -->|"evaluates"| node_evaluation
node_train -->|"calls plots"| node_visuals
node_train -->|"saves model"| node_trained_model
node_app_user -->|"enters measurements"| node_input_form
node_input_form -->|"submits input"| node_predict
node_app_model -->|"loaded by"| node_predict
node_predict -->|"displays prediction"| node_result
node_result -->|"presents result"| node_app_user

click node_dataset "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/Diabetes%20Data/diabetes.csv"
click node_train "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py"
click node_features "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py"
click node_split "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py"
click node_classifier "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py"
click node_trained_model "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/diabetes_model.pkl"
click node_evaluation "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py"
click node_visuals "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/visuals.py"
click node_input_form "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py"
click node_app_model "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/model/diabetes_model.pkl"
click node_predict "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py"
click node_result "https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py"

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_dataset,node_train,node_features,node_split,node_classifier,node_trained_model,node_app_user toneBlue
class node_evaluation,node_visuals toneAmber
class node_input_form,node_app_model,node_predict,node_result toneMint
```

## Components

### Model Training

- [Pima Dataset](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/Diabetes%20Data/diabetes.csv): `Diabetes Data/diabetes.csv`
- [Training Workflow](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py): `main.py`
- [Feature / Label Split](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py): `main.py`
- [Train-Test Split](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py): `main.py`
- [Logistic Regression](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py): `main.py`
- [Training Artifact](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/diabetes_model.pkl): `diabetes_model.pkl`

### Evaluation & Visuals

- [Metrics & Predictions](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/main.py): `main.py`
- [Plot Functions](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/visuals.py): `visuals.py`

### Prediction App

- [Measurement Inputs](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py): `app.py`
- [Loaded Model](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/model/diabetes_model.pkl): `model/diabetes_model.pkl`
- [Prediction & Confidence](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py): `app.py`
- [Displayed Result](https://github.com/hemanth-karumanchi/daibetes_predictor_app/blob/main/app.py): `app.py`

### Other components

- **App User**

## Connections

- Pima Dataset → Training Workflow: read by
- Training Workflow → Feature / Label Split: prepares
- Feature / Label Split → Train-Test Split: provides data
- Training Workflow → Train-Test Split: splits data
- Training Workflow → Logistic Regression: fits model
- Training Workflow → Metrics & Predictions: evaluates
- Training Workflow → Plot Functions: calls plots
- Training Workflow → Training Artifact: saves model
- App User → Measurement Inputs: enters measurements
- Measurement Inputs → Prediction & Confidence: submits input
- Loaded Model → Prediction & Confidence: loaded by
- Prediction & Confidence → Displayed Result: displays prediction
- Displayed Result → App User: presents result
