# mohannimmalapudi2007-hue/hdi-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/mohannimmalapudi2007-hue/hdi-prediction
- Repository: https://github.com/mohannimmalapudi2007-hue/hdi-prediction

## Overview

This is a Flask-based HDI prediction application backed by a saved linear-regression model. The documented workflow runs from socio-economic inputs through validation and model inference to a displayed score and HDI category. Training and dataset assets are represented as a separate branch; their detailed implementation was not sampled, so those relationships are documented at README level.

Main entry points: [`app.py`](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py) (Flask Routes), [`templates/index.html`](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/templates/index.html) (Prediction Interface), [`notebooks/HDI_Prediction.ipynb`](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/notebooks/HDI_Prediction.ipynb) (Training Notebook), [`model/hdi_model.pkl`](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/model/hdi_model.pkl) (Saved Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Training Assets"]
  node_dataset["HDI Dataset<br/>[hdr_general.csv]"]
  node_notebook["Training Notebook"]
  node_model["Saved Model<br/>[hdi_model.pkl]"]
end

subgraph group_web["Prediction Web App"]
  node_flask["Flask Routes<br/>[app.py]"]
  node_validation["Input Validation<br/>[app.py]"]
  node_inference["HDI Inference<br/>[app.py]"]
  node_results["Prediction Interface<br/>[index.html]"]
  node_styles["Interface Styles<br/>[style.css]"]
end

node_user(("User"))

node_user -->|"submits inputs"| node_flask
node_flask -->|"validates inputs"| node_validation
node_flask -->|"runs prediction"| node_inference
node_inference -->|"loads model"| node_model
node_flask -->|"renders result"| node_results
node_results -.->|"shows score and category"| node_user
node_dataset -.->|"provides data"| node_notebook
node_notebook -.->|"saves trained model"| node_model
node_results -.->|"uses styles"| node_styles

click node_dataset "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/Dataset/hdr_general.csv"
click node_notebook "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/notebooks/HDI_Prediction.ipynb"
click node_model "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/model/hdi_model.pkl"
click node_flask "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py"
click node_validation "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py"
click node_inference "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py"
click node_results "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/templates/index.html"
click node_styles "https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/static/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_dataset,node_notebook,node_model,node_user toneBlue
class node_flask,node_validation,node_inference,node_results,node_styles toneAmber
```

## Components

### Training Assets

- [HDI Dataset](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/Dataset/hdr_general.csv): `Dataset/hdr_general.csv`
- [Training Notebook](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/notebooks/HDI_Prediction.ipynb): `notebooks/HDI_Prediction.ipynb`
- [Saved Model](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/model/hdi_model.pkl): `model/hdi_model.pkl`

### Prediction Web App

- [Flask Routes](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py): `app.py`
- [Input Validation](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py): `app.py`
- [HDI Inference](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/app.py): `app.py`
- [Prediction Interface](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/templates/index.html): `templates/index.html`
- [Interface Styles](https://github.com/mohannimmalapudi2007-hue/hdi-prediction/blob/main/static/style.css): `static/style.css`

### Other components

- **User**

## Connections

- User → Flask Routes: submits inputs (evidence: `app.py`)
- Flask Routes → Input Validation: validates inputs (evidence: `app.py`)
- Flask Routes → HDI Inference: runs prediction (evidence: `app.py`)
- HDI Inference → Saved Model: loads model (evidence: `app.py`)
- Flask Routes → Prediction Interface: renders result (evidence: `app.py`)
- Prediction Interface → User: shows score and category (evidence: `README.md`)
- HDI Dataset → Training Notebook: provides data (evidence: `README.md`)
- Training Notebook → Saved Model: saves trained model (evidence: `README.md`)
- Prediction Interface → Interface Styles: uses styles (evidence: `README.md`)
