Skip to content

Repository files navigation

UniKT

A unified framework for reproducible knowledge-tracing research

From raw interactions to reliable experiments, evaluation, and insight.

Python 3.12 PyTorch 2.10 Managed with pixi MIT License

Read the documentation

Quick start  ·  Commands  ·  Web manager


UniKT brings data preparation, training, hyperparameter search, evaluation, efficiency benchmarking, and case analysis into one consistent workflow. Its extensible design lets researchers incorporate new models, data sources, and experiment configurations without disrupting established workflows.

Highlights

  • Reproducible by default — Pixi environments, a committed lockfile, archived run configurations, and deterministic execution where supported.
  • One workflow, end to end — download and process data, run cross-validation, track metrics, evaluate checkpoints, and inspect predictions.
  • Built for research — Optuna search, SwanLab integration, efficiency benchmarks, and prediction-level case analysis are included.
  • Easy to extend — add a trainer, configuration, or data source through the framework registry without changing the entry points.

Quick start

1 · Create the environment

git clone https://github.com/szhhwh/UniKT.git
cd UniKT
pixi install

The default environment uses CUDA 12.8 · Python 3.12 · PyTorch 2.10. Enter it with pixi shell, or run each command through pixi run as shown below.

Need another environment?
pixi shell -e cpu      # CPU-only
pixi shell -e mamba    # Mamba-based models
pixi shell -e xlstm    # xLSTM-based models
pixi shell -e dhg-gpu  # DHG-based models on CUDA 11.7
pixi shell -e dhg-cpu  # DHG-based models on CPU

2 · Prepare data

pixi run python data_process.py download -d assistments09
pixi run python data_process.py process -d assistments09

Built-in processors cover ASSISTments, EdNet-KT1, Junyi 2015, KDD Cup 2010, MOOC-Radar, NIPS 2020, Practice Anatomy, Slepemapy, and XES3G5M. Check the active options with pixi run python data_process.py download --help.

3 · Train

# Train one validation fold.
pixi run python train.py -m GIKT -d assistments09 --fold 0

# Train several folds with the included helper.
PYTHON="pixi run python" bash scripts/run_kfold.sh GIKT "0 1 2 3 4" -d assistments09

Each experiment is saved under runs/ with its resolved configuration, checkpoints, and metrics.

Common commands

Task Command
Train a model pixi run python train.py -m <model> -d <dataset>
Search hyperparameters pixi run python optuna_search.py -m <model> -d <dataset>
Evaluate a saved run pixi run python evaluate.py --run_dir runs/normal/<run_id>
Benchmark efficiency pixi run python efficiency.py -m <model> -d <dataset>
Inspect model predictions pixi run python case_analysis.py inference --run_dir runs/normal/<run_id>

Tip

Every command exposes its current, code-generated reference through --help. For model-specific options, run pixi run python train.py -m <model> --help.

Tracking experiments

Metrics are always written locally. SwanLab tracking is enabled by default; sign in once before logging runs to the service:

pixi run swanlab login

For a local-only run, pass --general.swanlab false. Optional SWANLAB_WORKSPACE, SWANLAB_MODE, and LARK_WEBHOOK_URL settings belong in .env.

Web manager

Launch, monitor, and manage experiments in a browser with the optional web interface.

pixi install -e web
cd web/frontend && npm install && cd ../..
pixi run web-serve

Open localhost:5173, then see the web manager guide for development details.

Acknowledgments

UniKT builds upon the excellent work of pyKT, which provided valuable references for several knowledge-tracing implementations.

License

Released under the MIT License.

About

UniKT: An unify experiment framework for Knowledge Tracing, fast and easy to use.

Topics

Resources

Stars

Watchers

Forks

Releases

Contributors

Languages