# prajwaln9741/ml-student-performance-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/prajwaln9741/ml-student-performance-prediction
- Repository: https://github.com/prajwaln9741/ml-student-performance-prediction

## Overview

StudentLens is a Flask-based student pass/fail prediction application. Users can view predictions and analysis for the default dataset, upload CSV/Excel data or submit an individual student, then inspect predictions, probabilities, charts, and insights and download results. A separate training workflow preprocesses data, compares classifiers, selects a best model, and saves metrics and charts. The application also documents feature-importance and SHAP explanations. Most runtime responsibilities appear concentrated in app.py; unsampled route details are represented only where the README documents them.

Main entry points: [`app.py`](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py) (Flask application), [`train_model.py`](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/train_model.py) (Train and select model), [`uploads/student_data.csv`](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/uploads/student_data.csv) (Student dataset), [`templates/upload.html`](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/templates/upload.html) (Upload interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_training_workflow["Train and select model<br/>[train_model.py]"]
end

subgraph group_application["Prediction app"]
  node_flask_app["Flask application<br/>[app.py]"]
  node_upload_ui["Upload interface<br/>[upload.html]"]
  node_prediction["Pass/fail prediction<br/>[app.py]"]
  node_default_view["Default dataset view<br/>[app.py]"]
  node_individual_form["Individual prediction<br/>[app.py]"]
end

subgraph group_analysis["Results and insights"]
  node_visualizations["Charts and dashboards<br/>[app.py]"]
  node_explanations["Insights and explanations<br/>[app.py]"]
  node_downloads["Prediction downloads<br/>[app.py]"]
end

subgraph group_persistence["Data and artifacts"]
  node_model_artifact["Selected model<br/>[model.pkl]"]
  node_metrics_artifact["Algorithm metrics<br/>[algo_metrics.json]"]
  node_training_data["Student dataset<br/>[student_data.csv]"]
  node_data_input["Uploaded data"]
  node_output_files["Prediction files"]
  node_chart_files["Chart artifacts"]
end

node_user(("Student or analyst"))
node_trainer(("Model trainer"))

node_trainer -->|"runs"| node_training_workflow
node_training_data -->|"trains on"| node_training_workflow
node_training_workflow -->|"saves model"| node_model_artifact
node_training_workflow -->|"saves metrics"| node_metrics_artifact
node_training_workflow -->|"generates charts"| node_chart_files
node_user -->|"submits data"| node_upload_ui
node_upload_ui -->|"serves interface"| node_flask_app
node_user -->|"opens app"| node_flask_app
node_data_input -->|"receives uploads"| node_flask_app
node_flask_app -->|"validates and predicts"| node_prediction
node_model_artifact -->|"provides model"| node_prediction
node_training_data -->|"provides default data"| node_default_view
node_flask_app -->|"renders view"| node_default_view
node_flask_app -.->|"accepts student fields"| node_individual_form
node_individual_form -.->|"requests prediction"| node_prediction
node_prediction -->|"feeds analysis"| node_visualizations
node_prediction -->|"feeds insights"| node_explanations
node_visualizations -->|"displays charts"| node_chart_files
node_prediction -->|"writes results"| node_output_files
node_output_files -->|"provides CSV"| node_downloads
node_user -->|"downloads results"| node_downloads

click node_training_workflow "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/train_model.py"
click node_model_artifact "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/model.pkl"
click node_metrics_artifact "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/algo_metrics.json"
click node_training_data "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/uploads/student_data.csv"
click node_flask_app "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_upload_ui "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/templates/upload.html"
click node_data_input "https://github.com/prajwaln9741/ml-student-performance-prediction/tree/main/uploads"
click node_prediction "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_default_view "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_individual_form "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_visualizations "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_explanations "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_downloads "https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py"
click node_output_files "https://github.com/prajwaln9741/ml-student-performance-prediction/tree/main/outputs"
click node_chart_files "https://github.com/prajwaln9741/ml-student-performance-prediction/tree/main/static/charts"

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_workflow toneBlue
class node_flask_app,node_upload_ui,node_prediction,node_default_view,node_individual_form toneAmber
class node_visualizations,node_explanations,node_downloads toneMint
class node_model_artifact,node_metrics_artifact,node_training_data,node_data_input,node_output_files,node_chart_files toneRose
class node_user,node_trainer toneIndigo
```

## Components

### Model training

- [Train and select model](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/train_model.py): `train_model.py`

### Prediction app

- [Flask application](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`
- [Upload interface](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/templates/upload.html): `templates/upload.html`
- [Pass/fail prediction](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`
- [Default dataset view](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`
- [Individual prediction](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`

### Results and insights

- [Charts and dashboards](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`
- [Insights and explanations](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`
- [Prediction downloads](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/app.py): `app.py`

### Data and artifacts

- [Selected model](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/model.pkl): `model.pkl`
- [Algorithm metrics](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/algo_metrics.json): `algo_metrics.json`
- [Student dataset](https://github.com/prajwaln9741/ml-student-performance-prediction/blob/main/uploads/student_data.csv): `uploads/student_data.csv`
- [Uploaded data](https://github.com/prajwaln9741/ml-student-performance-prediction/tree/main/uploads): `uploads`
- [Prediction files](https://github.com/prajwaln9741/ml-student-performance-prediction/tree/main/outputs): `outputs`
- [Chart artifacts](https://github.com/prajwaln9741/ml-student-performance-prediction/tree/main/static/charts): `static/charts`

### Other components

- **Student or analyst**
- **Model trainer**

## Connections

- Model trainer → Train and select model: runs (evidence: `README.md`)
- Student dataset → Train and select model: trains on (evidence: `README.md`)
- Train and select model → Selected model: saves model (evidence: `README.md`)
- Train and select model → Algorithm metrics: saves metrics (evidence: `README.md`)
- Train and select model → Chart artifacts: generates charts (evidence: `README.md`)
- Student or analyst → Upload interface: submits data (evidence: `README.md`)
- Upload interface → Flask application: serves interface (evidence: `README.md`)
- Student or analyst → Flask application: opens app (evidence: `README.md`)
- Uploaded data → Flask application: receives uploads (evidence: `README.md`)
- Flask application → Pass/fail prediction: validates and predicts (evidence: `README.md`)
- Selected model → Pass/fail prediction: provides model (evidence: `README.md`)
- Student dataset → Default dataset view: provides default data (evidence: `README.md`)
- Flask application → Default dataset view: renders view (evidence: `README.md`)
- Flask application → Individual prediction: accepts student fields (evidence: `app.py`)
- Individual prediction → Pass/fail prediction: requests prediction (evidence: `app.py`)
- Pass/fail prediction → Charts and dashboards: feeds analysis (evidence: `README.md`)
- Pass/fail prediction → Insights and explanations: feeds insights (evidence: `README.md`)
- Charts and dashboards → Chart artifacts: displays charts (evidence: `README.md`)
- Pass/fail prediction → Prediction files: writes results (evidence: `README.md`)
- Prediction files → Prediction downloads: provides CSV (evidence: `README.md`)
- Student or analyst → Prediction downloads: downloads results (evidence: `README.md`)
