# doneria-anjali/student-performance-predictor architecture

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

- Interactive diagram: https://gitdiagram.com/doneria-anjali/student-performance-predictor
- Repository: https://github.com/doneria-anjali/student-performance-predictor

## Overview

1. **Project purpose**
   - This repository is an offline educational-data-mining pipeline for comparing two prediction approaches on student learning data: **Support Vector Machines (SVM)** and **Bayesian Knowledge Tracing (BKT)**.
   - The core use case is to predict student performance from features such as knowledge components and step duration, using the **KDDCup 2010 / Algebra 2005-2006** tutoring-system data.

2. **Primary input data**
   - The `algebra_2005_2006/` directory contains the raw dataset extracts:
     - `algebra_2005_2006.txt`
     - `algebra_2005_2006_master.txt`
     - `algebra_2005_2006_test.txt`
   - These appear to be the source records for training/testing and likely represent different splits or views of the same tutoring-system data.

3. **Data preparation subsystem**
   - `data-cleaning.py` is the preprocessing stage.
   - Its role is to transform the raw text dataset into an analysis-ready tabular form, producing `clean_full_latest.csv`.
   - This is a clear architectural boundary: raw educational logs in, normalized CSV out.

4. **Shared processed dataset**
   - `clean_full_latest.csv` is the central intermediate artifact.
   - Both prediction implementations likely consume this cleaned dataset rather than reading the raw text files directly.
   - In the architecture diagram, this file should be treated as the handoff point between preprocessing and modeling.

5. **SVM prediction subsystem**
   - `svm_student.py` implements the SVM-based learner-performance predictor.
   - The README indicates the model uses **knowledge components** and **step duration** as features, with the target being correctness of the attempt.
   - This is the supervised-learning branch of the system.

6. **BKT prediction subsystem**
   - `bkt_method.py` implements the BKT model.
   - BKT is used to estimate latent skill mastery over time from student interaction sequences.
   - This is the sequential / tutoring-model branch, distinct from the feature-based SVM approach.

7. **Comparison-oriented architecture**
   - The repository is not an end-to-end product with a user interface; it is a **research/experiment pipeline**.
   - The key architectural outcome is comparison of model behavior and prediction results between SVM and BKT on the same dataset.
   - Any diagram should show both models fed from the same cleaned data source, with their outputs compared analytically.

8. **Database and SQL layer**
   - `database.py` and `sql_script.sql` suggest a persistence layer used for loading, querying, or structuring the student data.
   - This is likely auxiliary infrastructure for data management rather than the core modeling logic.
   - If diagramming, place this as an optional supporting layer beneath preprocessing/modeling, not as the main runtime service.

9. **Execution style**
   - The repository is Python-script driven, not service-based.
   - The likely execution flow is batch-oriented: load raw data, clean it, run one or both models, inspect results.
   - There is no evidence of a web server, API layer, or interactive application boundary.

10. **Outputs and artifacts**
   - The main output artifacts are the cleaned CSV and model predictions/evaluation results generated by the Python scripts.
   - `adoneri_stdoshi_final_report.pdf` is the documentation/report artifact, summarizing the experiment and findings rather than participating in runtime flow.

11. **Important boundaries**
   - Boundary 1: **raw educational logs vs cleaned features**
   - Boundary 2: **feature-based prediction (SVM) vs mastery-tracking prediction (BKT)**
   - Boundary 3: **analysis code vs optional persistence/SQL support**
   - These are the most important separations for an accurate architecture diagram.

12. **Recommended diagram shape**
   - Show a left-to-right pipeline: raw Algebra/KDDCup data → cleaning/transformation → shared CSV/table → two parallel model branches (SVM and BKT) → prediction/evaluation comparison.
   - Keep the database/SQL pieces as a supporting subsystem connected to the data preparation or storage stage, not the main application center.

Main entry points: [`data-cleaning.py`](https://github.com/doneria-anjali/student-performance-predictor/blob/master/data-cleaning.py) (Cleaner), [`clean_full_latest.csv`](https://github.com/doneria-anjali/student-performance-predictor/blob/master/clean_full_latest.csv) (Clean CSV), [`algebra_2005_2006`](https://github.com/doneria-anjali/student-performance-predictor/tree/master/algebra_2005_2006) (Algebra data), [`algebra_2005_2006/algebra_2005_2006.txt`](https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006.txt) (Raw logs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_raw_data["Raw data"]
  node_raw_dir[("Algebra data<br/>dataset")]
  node_raw_txt["Raw logs<br/>dataset file"]
  node_raw_master["Master split<br/>dataset file"]
  node_raw_test["Test split<br/>dataset file"]
end

subgraph group_prep["Preparation"]
  node_clean_script["Cleaner<br/>preprocess script<br/>[data-cleaning.py]"]
  node_clean_csv["Clean CSV<br/>processed dataset"]
  node_feature_view["Feature view<br/>tabular features"]
  node_sequence_view["Sequence view<br/>interaction sequence"]
end

subgraph group_models["Models"]
  node_svm_script["SVM predictor<br/>supervised model<br/>[svm_student.py]"]
  node_svm_eval["SVM results<br/>evaluation output"]
  node_bkt_script["BKT method<br/>sequential model<br/>[bkt_method.py]"]
  node_bkt_eval["BKT results<br/>evaluation output"]
  node_compare(("Compare models<br/>analysis"))
end

subgraph group_support["Support"]
  node_db_layer[("Database<br/>persistence layer<br/>[database.py]")]
  node_sql_script["SQL script<br/>schema/query<br/>[sql_script.sql]"]
end

node_raw_dir -->|"contains"| node_raw_txt
node_raw_dir -->|"contains"| node_raw_master
node_raw_dir -->|"contains"| node_raw_test
node_raw_txt -->|"input"| node_clean_script
node_raw_master -->|"input"| node_clean_script
node_raw_test -->|"input"| node_clean_script
node_clean_script -->|"produces"| node_clean_csv
node_clean_csv -->|"derives"| node_feature_view
node_clean_csv -->|"derives"| node_sequence_view
node_db_layer -->|"uses"| node_sql_script
node_clean_script -.->|"loads"| node_db_layer
node_sql_script -.->|"supports"| node_clean_csv
node_feature_view -->|"features"| node_svm_script
node_svm_script -->|"outputs"| node_svm_eval
node_sequence_view -->|"sequence"| node_bkt_script
node_bkt_script -->|"outputs"| node_bkt_eval
node_svm_eval -->|"compare"| node_compare
node_bkt_eval -->|"compare"| node_compare

click node_raw_dir "https://github.com/doneria-anjali/student-performance-predictor/tree/master/algebra_2005_2006"
click node_raw_txt "https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006.txt"
click node_raw_master "https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006_master.txt"
click node_raw_test "https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006_test.txt"
click node_clean_script "https://github.com/doneria-anjali/student-performance-predictor/blob/master/data-cleaning.py"
click node_clean_csv "https://github.com/doneria-anjali/student-performance-predictor/blob/master/clean_full_latest.csv"
click node_db_layer "https://github.com/doneria-anjali/student-performance-predictor/blob/master/database.py"
click node_sql_script "https://github.com/doneria-anjali/student-performance-predictor/blob/master/sql_script.sql"
click node_svm_script "https://github.com/doneria-anjali/student-performance-predictor/blob/master/svm_student.py"
click node_bkt_script "https://github.com/doneria-anjali/student-performance-predictor/blob/master/bkt_method.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_raw_dir,node_raw_txt,node_raw_master,node_raw_test toneBlue
class node_clean_script,node_clean_csv,node_feature_view,node_sequence_view toneAmber
class node_svm_script,node_svm_eval,node_bkt_script,node_bkt_eval,node_compare toneMint
class node_db_layer,node_sql_script toneRose
```

## Components

### Raw data

Algebra/KDDCup source extracts used as the common input corpus.

- [Algebra data](https://github.com/doneria-anjali/student-performance-predictor/tree/master/algebra_2005_2006): dataset · Repository bundle of student interaction logs from the Algebra 2005-2006/KDDCup 2010 data. · `algebra_2005_2006`
- [Raw logs](https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006.txt): dataset file · Primary raw text extract of the tutoring-system interactions. · `algebra_2005_2006/algebra_2005_2006.txt`
- [Master split](https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006_master.txt): dataset file · Master version of the Algebra 2005-2006 data used for training or consolidation. · `algebra_2005_2006/algebra_2005_2006_master.txt`
- [Test split](https://github.com/doneria-anjali/student-performance-predictor/blob/master/algebra_2005_2006/algebra_2005_2006_test.txt): dataset file · Held-out or alternate test view of the Algebra 2005-2006 data. · `algebra_2005_2006/algebra_2005_2006_test.txt`

### Preparation

Cleaning and shaping stages that turn raw logs into analysis-ready data.

- [Cleaner](https://github.com/doneria-anjali/student-performance-predictor/blob/master/data-cleaning.py): preprocess script · Transforms raw tutoring logs into a normalized analysis-ready table. · `data-cleaning.py`
- [Clean CSV](https://github.com/doneria-anjali/student-performance-predictor/blob/master/clean_full_latest.csv): processed dataset · Shared intermediate dataset consumed by both prediction branches. · `clean_full_latest.csv`
- **Feature view**: tabular features · Feature-oriented representation centered on knowledge components and step duration.
- **Sequence view**: interaction sequence · Ordered student-action sequences used to estimate mastery over time.

### Models

Parallel prediction approaches and their comparison outputs.

- [SVM predictor](https://github.com/doneria-anjali/student-performance-predictor/blob/master/svm_student.py): supervised model · Feature-based classifier for predicting correctness from student activity signals. · `svm_student.py`
- **SVM results**: evaluation output · Predictions and scoring from the SVM branch.
- [BKT method](https://github.com/doneria-anjali/student-performance-predictor/blob/master/bkt_method.py): sequential model · Bayesian Knowledge Tracing implementation for latent skill mastery estimation. · `bkt_method.py`
- **BKT results**: evaluation output · Predictions and mastery estimates from the BKT branch.
- **Compare models**: analysis · Side-by-side comparison of SVM and BKT behavior on the same cleaned dataset.

### Support

Auxiliary storage/query scripts that help manage the dataset.

- [Database](https://github.com/doneria-anjali/student-performance-predictor/blob/master/database.py): persistence layer · Supporting data storage/query layer for structuring student records. · `database.py`
- [SQL script](https://github.com/doneria-anjali/student-performance-predictor/blob/master/sql_script.sql): schema/query · SQL definitions or queries supporting dataset loading and organization. · `sql_script.sql`

## Connections

- Algebra data → Raw logs: contains · The raw dataset directory bundles the main text extract.
- Algebra data → Master split: contains · The raw dataset directory includes the master split.
- Algebra data → Test split: contains · The raw dataset directory includes the test split.
- Raw logs → Cleaner: input · Cleaner ingests the raw student interaction log.
- Master split → Cleaner: input · Cleaner can also consume the master view of the data.
- Test split → Cleaner: input · Cleaner can also consume the test view of the data.
- Cleaner → Clean CSV: produces · Preprocessing emits the shared cleaned CSV artifact.
- Clean CSV → Feature view: derives · SVM-oriented tabular features are derived from the cleaned table.
- Clean CSV → Sequence view: derives · BKT-oriented interaction sequences are derived from the cleaned table.
- Database → SQL script: uses · Database helpers are backed by SQL definitions and queries.
- Cleaner → Database: loads · Preprocessing may use the persistence layer to stage or query records.
- SQL script → Clean CSV: supports · SQL layer supports shaping and extracting the cleaned dataset.
- Feature view → SVM predictor: features · Feature table feeds the SVM classifier.
- SVM predictor → SVM results: outputs · SVM branch produces predictions and evaluation artifacts.
- Sequence view → BKT method: sequence · Student interaction sequences feed the BKT model.
- BKT method → BKT results: outputs · BKT branch produces mastery estimates and predictions.
- SVM results → Compare models: compare · SVM results are compared against the alternative model.
- BKT results → Compare models: compare · BKT results are compared against the feature-based model.
