GithubHelp home page GithubHelp logo

kt-algos's Introduction

kt-algos

Simple and performant implementations of knowledge tracing algorithms:

Setup

In a new conda environment with python 3, install PyTorch and the remaining requirements:

pip install -r requirements.txt

The code supports the following datasets:

Dataset # Users # Items # Skills # Interactions Mean # skills/item Timestamps Median length
assistments09 3,241 26,634 124 397,137 1.20 No 26
assistments12 29,018 53,086 265 2,711,602 1.00 Yes 49
assistments15 14,567 100 100 658,887 1.00 No 20
assistments17 1,708 3,162 102 942,814 1.23 Yes 441
bridge_algebra06 1,146 129,263 493 1,817,476 1.01 Yes 1,362
algebra05 574 173,113 112 607,025 1.36 Yes 574

To use a dataset, download the data from one of the links above and place the main file under data/<dataset codename>/data.csv if it is an ASSISTments dataset and under data/<dataset codename>/data.txt otherwise. To preprocess a dataset:

python prepare_data.py --dataset <dataset codename> --remove_nan_skills

Training

Logistic regression

To encode a sparse feature matrix with specified features:

python encode_lr.py --dataset <dataset codename> --items --skills --wins --attempts --time_windows

To train a logistic regression model with a sparse feature matrix encoded through encode_lr.py:

python train_lr.py data/<dataset codename>/X-lr-iswa_tw.npz --dataset <dataset codename>

Feedforward neural network

To encode a sparse feature matrix with specified features:

python encode_ffw.py --dataset <dataset codename> --total --items --num_prev_interactions=1

To train a feedforward neural network model with a dense feature matrix encoded through encode_ffw.py:

python train_ffw.py data/<dataset codename>/X-ffw-ti-1.npz --dataset <dataset codename>

Deep knowledge tracing

To train a DKT model:

python train_dkt.py --dataset <dataset codename> --embed_inputs

Self-attentive knowledge tracing

To train a SAKT model:

python train_sakt.py --dataset <dataset codename> --embed_inputs 

Results

Algorithm assistments09 assistments12 assistments15 assistments17 bridge_algebra06 algebra05
IRT 0.69 0.71 0.64 0.68 0.75 0.77
PFA 0.77 0.75 0.70 0.71 0.80 0.83
DAS3H - 0.75 - 0.72 0.79 0.83
FFW 0.78 0.71 0.71
DKT
SAKT

Legend for results in table:

  • IRT: logistic regression with --item flags
  • PFA: logistic regression with --item --skills --wins --attempts flags
  • DAS3H: logistic regression with --item --skills --wins --attempts --time_windows flags
  • FFW: feedforward neural network with --total --items --num_prev_interactions=1 flags

kt-algos's People

Contributors

theophilegervet avatar thosgt avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.