# kali-kar/student-performance-predictor architecture

> Architecture diagram of the GitHub repository kali-kar/student-performance-predictor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kali-kar/student-performance-predictor
- Repository: https://github.com/kali-kar/student-performance-predictor

## Overview

Student Performance Predictor generates or loads student data, trains and evaluates regression models, saves the selected model artifacts, then accepts student details through a Flask form and returns a score, grade, and remark. The graph preserves the notebook-based EDA/training path documented in the README. The notebook, templates, styles, and serialized artifacts are represented from the tree and README; their source contents were not sampled.

Main entry points: [`app/app.py`](https://github.com/kali-kar/student-performance-predictor/blob/main/app/app.py) (Flask application), [`model/train_model.py`](https://github.com/kali-kar/student-performance-predictor/blob/main/model/train_model.py) (Train and evaluate), [`app/templates/index.html`](https://github.com/kali-kar/student-performance-predictor/blob/main/app/templates/index.html) (Input and results), [`data/student_data.csv`](https://github.com/kali-kar/student-performance-predictor/blob/main/data/student_data.csv) (Student dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data"]
  node_generator["Synthetic data<br/>[generate_data.py]"]
  node_dataset[("Student dataset<br/>[student_data.csv]")]
end

subgraph group_training["Model training"]
  node_notebook["EDA and training"]
  node_trainer["Train and evaluate<br/>[train_model.py]"]
end

subgraph group_artifacts["Saved artifacts"]
  node_predictor[("Selected regressor<br/>[student_model.pkl]")]
  node_scaler[("Feature scaler<br/>[scaler.pkl]")]
  node_metadata["Model metadata<br/>[model_meta.pkl]"]
end

subgraph group_web["Web prediction"]
  node_flask["Flask application<br/>[app.py]"]
  node_form["Input and results<br/>[index.html]"]
  node_styles["Web styling<br/>[style.css]"]
  node_grade["Grade and remark<br/>[app.py]"]
end

node_user(("Student"))

node_generator -->|"writes CSV"| node_dataset
node_trainer -->|"reads data"| node_dataset
node_notebook -->|"loads or generates"| node_dataset
node_notebook -->|"saves selected model"| node_predictor
node_trainer -->|"saves selected model"| node_predictor
node_trainer -->|"saves scaler"| node_scaler
node_trainer -->|"saves metadata"| node_metadata
node_user -->|"submits details"| node_flask
node_flask -->|"loads and predicts"| node_predictor
node_flask -->|"loads and transforms"| node_scaler
node_flask -->|"loads features"| node_metadata
node_flask -->|"renders form"| node_form
node_flask -->|"calculates grade"| node_grade
node_grade -->|"renders result"| node_form
node_form -.->|"uses styling"| node_styles
node_flask -->|"returns prediction"| node_user

click node_generator "https://github.com/kali-kar/student-performance-predictor/blob/main/data/generate_data.py"
click node_dataset "https://github.com/kali-kar/student-performance-predictor/blob/main/data/student_data.csv"
click node_notebook "https://github.com/kali-kar/student-performance-predictor/blob/main/notebook/Student_Performance_Prediction.ipynb"
click node_trainer "https://github.com/kali-kar/student-performance-predictor/blob/main/model/train_model.py"
click node_predictor "https://github.com/kali-kar/student-performance-predictor/blob/main/model/student_model.pkl"
click node_scaler "https://github.com/kali-kar/student-performance-predictor/blob/main/model/scaler.pkl"
click node_metadata "https://github.com/kali-kar/student-performance-predictor/blob/main/model/model_meta.pkl"
click node_flask "https://github.com/kali-kar/student-performance-predictor/blob/main/app/app.py"
click node_form "https://github.com/kali-kar/student-performance-predictor/blob/main/app/templates/index.html"
click node_styles "https://github.com/kali-kar/student-performance-predictor/blob/main/app/static/style.css"
click node_grade "https://github.com/kali-kar/student-performance-predictor/blob/main/app/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_generator,node_dataset toneBlue
class node_notebook,node_trainer toneAmber
class node_predictor,node_scaler,node_metadata toneMint
class node_flask,node_form,node_styles,node_grade toneRose
class node_user toneIndigo
```

## Components

### Data

- [Synthetic data](https://github.com/kali-kar/student-performance-predictor/blob/main/data/generate_data.py): `data/generate_data.py`
- [Student dataset](https://github.com/kali-kar/student-performance-predictor/blob/main/data/student_data.csv): `data/student_data.csv`

### Model training

- [EDA and training](https://github.com/kali-kar/student-performance-predictor/blob/main/notebook/Student_Performance_Prediction.ipynb): `notebook/Student_Performance_Prediction.ipynb`
- [Train and evaluate](https://github.com/kali-kar/student-performance-predictor/blob/main/model/train_model.py): `model/train_model.py`

### Saved artifacts

- [Selected regressor](https://github.com/kali-kar/student-performance-predictor/blob/main/model/student_model.pkl): `model/student_model.pkl`
- [Feature scaler](https://github.com/kali-kar/student-performance-predictor/blob/main/model/scaler.pkl): `model/scaler.pkl`
- [Model metadata](https://github.com/kali-kar/student-performance-predictor/blob/main/model/model_meta.pkl): `model/model_meta.pkl`

### Web prediction

- [Flask application](https://github.com/kali-kar/student-performance-predictor/blob/main/app/app.py): `app/app.py`
- [Input and results](https://github.com/kali-kar/student-performance-predictor/blob/main/app/templates/index.html): `app/templates/index.html`
- [Web styling](https://github.com/kali-kar/student-performance-predictor/blob/main/app/static/style.css): `app/static/style.css`
- [Grade and remark](https://github.com/kali-kar/student-performance-predictor/blob/main/app/app.py): `app/app.py`

### Other components

- **Student**

## Connections

- Synthetic data → Student dataset: writes CSV (evidence: `data/generate_data.py`)
- Train and evaluate → Student dataset: reads data (evidence: `model/train_model.py`)
- EDA and training → Student dataset: loads or generates (evidence: `README.md`)
- EDA and training → Selected regressor: saves selected model (evidence: `README.md`)
- Train and evaluate → Selected regressor: saves selected model (evidence: `model/train_model.py`)
- Train and evaluate → Feature scaler: saves scaler (evidence: `model/train_model.py`)
- Train and evaluate → Model metadata: saves metadata (evidence: `model/train_model.py`)
- Student → Flask application: submits details (evidence: `README.md`)
- Flask application → Selected regressor: loads and predicts (evidence: `app/app.py`)
- Flask application → Feature scaler: loads and transforms (evidence: `app/app.py`)
- Flask application → Model metadata: loads features (evidence: `app/app.py`)
- Flask application → Input and results: renders form (evidence: `app/app.py`)
- Flask application → Grade and remark: calculates grade (evidence: `app/app.py`)
- Grade and remark → Input and results: renders result (evidence: `app/app.py`)
- Input and results → Web styling: uses styling (evidence: `README.md`)
- Flask application → Student: returns prediction (evidence: `README.md`)
