How cahlr/pybkt-examples works
1. This repository is an experiment suite around the external pyBKT library, not a reusable application service. Each top-level Python file is a standalone analysis script that runs one Bayesian Knowledge Tracing variant and prints/compares metrics such as AUC and RMSE.
2. The main computational boundary is between the experiment scripts and the input datasets in data/. The scripts consume CSVs or text exports, transform them into the format expected by pyBKT, fit models, and evaluate predictions. There is no database, API, or long-running backend.
3. The top-level modeling scripts represent separate experiment variants:
- BasicForgets.py for standard BKT and a forgets extension
- KtIdem.py for item difficulty / template-based guessing effects
- KtPps.py for prior-per-student behavior
- ItemOrderEffect.py for order-sensitive learning effects
- ItemLearningEffect.py for item-specific learning effects
These are independent workflows rather than modules in a single runtime graph.
4. The data/ directory is the primary data subsystem. It contains a mix of raw inputs and derived artifacts:
- assistments-style CSV files such as as.csv, ct.csv, builder_train.csv, and builder_test.csv
- preprocessed versions of those files
- raw GLOPS problem-set text files under data/glops-exact/
- processed GLOPS CSVs under data/glops-exact-processed/
This suggests an offline preprocessing stage that converts source logs into analysis-ready tables.
5. The data preprocessing utilities are data/filter_glops.py and data/filter_nips.py. These are the only explicit transformation scripts in the tree and likely sit upstream of the model scripts, cleaning or filtering source datasets before model fitting.
6. The GLOPS dataset appears to be a major input path for the prior-per-student experiment. The raw .txt problem-set files are mirrored as processed .csv files, indicating a pipeline of raw export → normalization/filtering → per-problem-set model evaluation.
7. The Assistments and Cognitive Tutor files support the other experiments, especially item difficulty, item order, and item learning effects. The readme indicates that these scripts use template IDs or skill IDs as the key modeling dimension, so the effective data flow is from per-attempt student response rows into skill/template-specific BKT variants.
8. The output of the system is primarily research metrics and tables, not stored artifacts. Each script appears to compute model parameters and then compare predicted correctness against held-out responses using cross-validation or train/test splits, with results reported in the readme rather than written to a persistent results store.
9. The repo depends on a small scientific Python stack: numpy, pandas, requests, and scikit-learn, plus the external pyBKT package. Architecturally, this means all computation happens locally in Python, with no special runtime infrastructure beyond the installed library and the input files.
10. The important architectural diagram should show a simple offline research pipeline: source educational datasets in data/ feed preprocessing scripts, which feed one of several standalone model-evaluation scripts, which in turn invoke pyBKT to fit BKT variants and emit evaluation metrics and comparison tables.
11. There is no shared application state across experiments. The top-level scripts are effectively separate entry points that reuse the same modeling library and dataset families, so coupling is low except for common assumptions about student-response table formats and template/skill identifiers.
12. In short, this repository is a collection of reproducible modeling examples for educational data mining. Its structure is dominated by dataset preparation and experiment-specific analysis scripts, with pyBKT as the core engine and the data/ directory as the main integration boundary.
Main entry points: KtIdem.py KtIdem · ItemOrderEffect.py ItemOrderEffect · ItemLearningEffect.py ItemLearningEffect · as.csv Assistments CSVs
Components 17
Data
Raw and processed educational datasets plus preprocessing scripts.
- Assistments CSVs · Assistments-style student response tables for several experiments.
data/as.csv - Cognitive Tutor CSV · Cognitive Tutor response data used as an experiment input.
data/ct.csv - Builder train · Training split for Assistments-style modeling.
data/builder_train.csv - Builder test · Test split for Assistments-style evaluation.
data/builder_test.csv - Train preprocessed · Normalized training table for downstream model fitting.
data/builder_train_preprocessed.csv - Test preprocessed · Normalized test table for downstream prediction checks.
data/builder_test_preprocessed.csv - GLOPS texts · Raw problem-set exports used for prior-per-student experiments.
data/glops-exact - GLOPS CSVs · Filtered and normalized GLOPS tables for analysis.
data/glops-exact-processed - Filter GLOPS · Converts raw GLOPS text exports into analysis-ready CSVs.
data/filter_glops.py - Filter NIPS · Cleans and reshapes source data for the experiment scripts.
data/filter_nips.py
Experiments
Standalone Bayesian Knowledge Tracing variants and evaluation scripts.
- BasicForgets · Standard BKT and forgets variant benchmark.
BasicForgets.py - KtIdem · Item difficulty and template-based guessing experiment.
KtIdem.py - KtPps · Prior-per-student experiment over GLOPS-style inputs.
KtPps.py - ItemOrderEffect · Order-sensitive learning effect experiment.
ItemOrderEffect.py - ItemLearningEffect · Item-specific learning effect experiment.
ItemLearningEffect.py - Metrics · Reported AUC, RMSE, and comparison tables.
Other components
- pyBKT · External Bayesian Knowledge Tracing engine used by all experiments.
Connections 24
- Assistments CSVs → Filter NIPS: raw rows · Assistments-style tables are cleaned before modeling.
- Cognitive Tutor CSV → Filter NIPS: raw rows · Cognitive Tutor tables are cleaned before modeling.
- Builder train → Train preprocessed: preprocess · Training split is normalized for model input.
- Builder test → Test preprocessed: preprocess · Test split is normalized for evaluation.
- GLOPS texts → Filter GLOPS: raw exports · Raw GLOPS text files are converted to CSV.
- Filter GLOPS → GLOPS CSVs: writes · Preprocessing produces analysis-ready GLOPS CSVs.
- Filter NIPS → BasicForgets: feeds · Filtered student-response rows support the BKT baseline.
- Train preprocessed → KtIdem: feeds · Preprocessed builder training data supports item/template experiments.
- Test preprocessed → KtIdem: evaluates · Held-out builder data is used for prediction checks.
- GLOPS CSVs → KtPps: feeds · Processed GLOPS data drives prior-per-student modeling.
- Assistments CSVs → ItemOrderEffect: feeds · Assistments-style sequences support order-effect modeling.
- Cognitive Tutor CSV → ItemOrderEffect: feeds · Cognitive Tutor sequences support order-effect modeling.
- Assistments CSVs → ItemLearningEffect: feeds · Item-level response rows support learning-effect modeling.
- Cognitive Tutor CSV → ItemLearningEffect: feeds · Cognitive Tutor response rows support learning-effect modeling.
- BasicForgets → pyBKT: fits · Experiment scripts invoke the external BKT implementation.
- KtIdem → pyBKT: fits · Experiment scripts invoke the external BKT implementation.
- KtPps → pyBKT: fits · Experiment scripts invoke the external BKT implementation.
- ItemOrderEffect → pyBKT: fits · Experiment scripts invoke the external BKT implementation.
- ItemLearningEffect → pyBKT: fits · Experiment scripts invoke the external BKT implementation.
- BasicForgets → Metrics: reports · Outputs evaluation metrics and comparisons.
- KtIdem → Metrics: reports · Outputs evaluation metrics and comparisons.
- KtPps → Metrics: reports · Outputs evaluation metrics and comparisons.
- ItemOrderEffect → Metrics: reports · Outputs evaluation metrics and comparisons.
- ItemLearningEffect → Metrics: reports · Outputs evaluation metrics and comparisons.