# ankur-one/student-performance-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/ankur-one/student-performance-prediction
- Repository: https://github.com/ankur-one/student-performance-prediction

## Overview

Student Performance Prediction is a Streamlit application that predicts a student’s mathematics score from demographic details and reading/writing scores. The training workflow loads and splits the student dataset, preprocesses features, compares and tunes regression models, evaluates them, and saves the selected model and preprocessor. At runtime, the app collects inputs, builds a dataframe, applies the saved preprocessor and model, and displays the predicted score. Training wiring is evidenced by the executable in data_ingestion.py; cloud deployment is described in the README but its implementation is not shown.

Main entry points: [`src/components/data_ingestion.py`](https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/data_ingestion.py) (Data ingestion), [`app.py`](https://github.com/ankur-one/student-performance-prediction/blob/main/app.py) (Streamlit app), [`src/components/data_transformation.py`](https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/data_transformation.py) (Feature transformation), [`src/components/model_trainer.py`](https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/model_trainer.py) (Model trainer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Prediction interface"]
  node_app["Streamlit app<br/>[app.py]"]
  node_score["Math score"]
end

subgraph group_training["Model training"]
  node_ingestion["Data ingestion<br/>[data_ingestion.py]"]
  node_transformation["Feature transformation"]
  node_trainer["Model trainer<br/>[model_trainer.py]"]
  node_evaluation["Model evaluation<br/>[utils.py]"]
  node_save_object["Artifact saver<br/>[utils.py]"]
end

subgraph group_inference["Prediction runtime"]
  node_custom_data["Input dataframe"]
  node_predict["Predict pipeline"]
  node_load_object["Artifact loader<br/>[utils.py]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_source_data["Student dataset<br/>[stud.csv]"]
  node_raw_csv["Raw data CSV<br/>[data.csv]"]
  node_train_csv["Training CSV<br/>[train.csv]"]
  node_test_csv["Test CSV<br/>[test.csv]"]
  node_preprocessor["Preprocessor<br/>[preprocessor.pkl]"]
  node_model["Selected model<br/>[model.pkl]"]
end

node_student(("Student"))

node_student -->|"enters details"| node_app
node_app -->|"constructs input"| node_custom_data
node_custom_data -->|"returns dataframe"| node_app
node_app -->|"requests prediction"| node_predict
node_predict -->|"loads artifacts"| node_load_object
node_load_object -->|"reads"| node_preprocessor
node_load_object -->|"reads"| node_model
node_predict -->|"returns prediction"| node_score
node_app -->|"displays"| node_score
node_source_data -->|"read by"| node_ingestion
node_ingestion -->|"writes"| node_raw_csv
node_ingestion -->|"writes split"| node_train_csv
node_ingestion -->|"writes split"| node_test_csv
node_ingestion -->|"calls"| node_transformation
node_train_csv -->|"read by"| node_transformation
node_test_csv -->|"read by"| node_transformation
node_transformation -->|"saves"| node_preprocessor
node_transformation -->|"returns arrays"| node_trainer
node_ingestion -->|"calls"| node_trainer
node_trainer -->|"evaluates models"| node_evaluation
node_evaluation -->|"returns scores"| node_trainer
node_trainer -->|"saves selected model"| node_save_object
node_save_object -->|"writes"| node_model

click node_app "https://github.com/ankur-one/student-performance-prediction/blob/main/app.py"
click node_custom_data "https://github.com/ankur-one/student-performance-prediction/blob/main/src/pipeline/predict_pipeline.py"
click node_predict "https://github.com/ankur-one/student-performance-prediction/blob/main/src/pipeline/predict_pipeline.py"
click node_load_object "https://github.com/ankur-one/student-performance-prediction/blob/main/src/utils.py"
click node_source_data "https://github.com/ankur-one/student-performance-prediction/blob/main/notebook/data/stud.csv"
click node_ingestion "https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/data_ingestion.py"
click node_raw_csv "https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/data.csv"
click node_train_csv "https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/train.csv"
click node_test_csv "https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/test.csv"
click node_transformation "https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/data_transformation.py"
click node_preprocessor "https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/preprocessor.pkl"
click node_trainer "https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/model_trainer.py"
click node_evaluation "https://github.com/ankur-one/student-performance-prediction/blob/main/src/utils.py"
click node_model "https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/model.pkl"
click node_save_object "https://github.com/ankur-one/student-performance-prediction/blob/main/src/utils.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_app,node_score toneBlue
class node_ingestion,node_transformation,node_trainer,node_evaluation,node_save_object toneAmber
class node_custom_data,node_predict,node_load_object toneMint
class node_source_data,node_raw_csv,node_train_csv,node_test_csv,node_preprocessor,node_model toneRose
class node_student toneIndigo
```

## Components

### Prediction interface

- [Streamlit app](https://github.com/ankur-one/student-performance-prediction/blob/main/app.py): `app.py`
- **Math score**

### Model training

- [Data ingestion](https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/data_ingestion.py): `src/components/data_ingestion.py`
- [Feature transformation](https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/data_transformation.py): `src/components/data_transformation.py`
- [Model trainer](https://github.com/ankur-one/student-performance-prediction/blob/main/src/components/model_trainer.py): `src/components/model_trainer.py`
- [Model evaluation](https://github.com/ankur-one/student-performance-prediction/blob/main/src/utils.py): `src/utils.py`
- [Artifact saver](https://github.com/ankur-one/student-performance-prediction/blob/main/src/utils.py): `src/utils.py`

### Prediction runtime

- [Input dataframe](https://github.com/ankur-one/student-performance-prediction/blob/main/src/pipeline/predict_pipeline.py): `src/pipeline/predict_pipeline.py`
- [Predict pipeline](https://github.com/ankur-one/student-performance-prediction/blob/main/src/pipeline/predict_pipeline.py): `src/pipeline/predict_pipeline.py`
- [Artifact loader](https://github.com/ankur-one/student-performance-prediction/blob/main/src/utils.py): `src/utils.py`

### Data and artifacts

- [Student dataset](https://github.com/ankur-one/student-performance-prediction/blob/main/notebook/data/stud.csv): `notebook/data/stud.csv`
- [Raw data CSV](https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/data.csv): `artifacts/data.csv`
- [Training CSV](https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/train.csv): `artifacts/train.csv`
- [Test CSV](https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/test.csv): `artifacts/test.csv`
- [Preprocessor](https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/preprocessor.pkl): `artifacts/preprocessor.pkl`
- [Selected model](https://github.com/ankur-one/student-performance-prediction/blob/main/artifacts/model.pkl): `artifacts/model.pkl`

### Other components

- **Student**

## Connections

- Student → Streamlit app: enters details
- Streamlit app → Input dataframe: constructs input
- Input dataframe → Streamlit app: returns dataframe
- Streamlit app → Predict pipeline: requests prediction
- Predict pipeline → Artifact loader: loads artifacts
- Artifact loader → Preprocessor: reads
- Artifact loader → Selected model: reads
- Predict pipeline → Math score: returns prediction
- Streamlit app → Math score: displays
- Student dataset → Data ingestion: read by
- Data ingestion → Raw data CSV: writes
- Data ingestion → Training CSV: writes split
- Data ingestion → Test CSV: writes split
- Data ingestion → Feature transformation: calls
- Training CSV → Feature transformation: read by
- Test CSV → Feature transformation: read by
- Feature transformation → Preprocessor: saves
- Feature transformation → Model trainer: returns arrays
- Data ingestion → Model trainer: calls
- Model trainer → Model evaluation: evaluates models
- Model evaluation → Model trainer: returns scores
- Model trainer → Artifact saver: saves selected model
- Artifact saver → Selected model: writes
