pyKT Toolkit

repository·main·Indexed 19 days ago

https://github.com/pykt-team/pykt-toolkit

A PyTorch-based Python library providing a standardized framework for training, benchmarking, and experimenting with Deep Learning-based Knowledge Tracing (DLKT) models. It includes support for various benchmark datasets such as ASSISTments, Ednet, and NIPS34, and provides workflows for implementing new models and preprocessing educational data.

Tokens
13.9K
Snippets
31
Records
72
Agent score
64%

What's inside pyKT

  1. Overview of the pykt package structure

    main

    The pykt package is organized into several specialized subpackages that handle different stages of the knowledge tracing pipeline. When building or extending workflows, you will primarily interact with these modules:

    • pykt.config: Handles configuration management and hyperparameter settings.
    • pykt.datasets: Manages data loading, dataset creation, and data handling.
    • pykt.models: Contains the implementations of various knowledge tracing models.
    • pykt.preprocess: Provides tools for data preprocessing and cleaning.
    • pykt.utils: Contains general utility functions used across the toolkit.
  2. Overview of pyKT

    main

    pyKT is a Python library built on top of PyTorch designed for training deep learning-based Knowledge Tracing (KT) models. It provides a standardized framework for conducting extensive experiments in the KT domain by integrating:

    • Data Preprocessing: Standardized procedures for multiple popular datasets across different domains.
    • Prediction Scenarios: 5 detailed prediction scenarios for evaluating model performance.
    • DLKT Approaches: Frequently compared Deep Learning Knowledge Tracing (DLKT) models for transparent benchmarking.

    For academic details and the theoretical foundation of the library, refer to the paper: https://arxiv.org/abs/2206.11460.

  3. Explore the pykt.preprocess submodules

    main

    The pykt.preprocess package provides specialized preprocessing modules for various educational datasets and competition formats. Instead of a single generic preprocessing function, the toolkit provides specific modules tailored to the data structures of different research papers and competitions.

    Commonly used submodules include:

    • Competition-specific modules: aaai2022_competition, nips_task34_preprocess.
    • Dataset-specific modules: algebra2005_preprocess, assist2009_preprocess, assist2012_preprocess, assist2015_preprocess, assist2017_preprocess, bridge2algebra2006_preprocess, ednet_preprocess, junyi2015_preprocess, poj_preprocess, statics2011_preprocess.
    • Utility and Data Management: data_proprocess for general data handling, split_datasets and split_datasets_que for partitioning data into training/validation/test sets, and utils for shared preprocessing helper functions.
  4. Available Knowledge Tracing models in pykt.models

    main

    The pykt.models package contains a wide variety of Knowledge Tracing (KT) model implementations. Developers can choose from several specialized submodules depending on the specific architecture required for their task.

    Key model submodules include:

    • AKT variants: akt, akt_que
    • DKT variants: dkt, dkt_forget, dkt_plus, qdkt
    • SAINT variants: saint, saint_plus_plus
    • IEKT variants: iekt, iekt_ce
    • Other specialized models: atdkt, atkt, bakt_time, deep_irt, dimkt, dkvmn, gkt, kqn, lpkt, mtkt, qikt, sakt, simplekt, skvmn, sparsekt, denoisekt

    For model lifecycle management, use pykt.models.init_model to initialize models and pykt.models.train_model or pykt.models.evaluate_model for training and evaluation workflows.

  5. Overview of pyKT Model Categories

    main

    pyKT provides a wide range of Deep Knowledge Tracing (DLKT) models categorized by their underlying architecture. When selecting a model for your task, you can choose from the following categories:

    • Sequential Models: Models that use recurrent structures to model student learning over time (e.g., DKT, DKT+, DKT-Forget, KQN, LPKT, DIMKT, IEKT, qDKT, AT-DKT, reKT, simpleKT, QIKT).
    • Memory Augmented Models: Models that use memory matrices to store and retrieve knowledge states (e.g., DKVMN, SKVMN, DeepIKT).
    • Adversarial Based Models: Models that use adversarial training to improve generalization (e.g., ATKT).
    • Graph Based Models: Models that use Graph Neural Networks (GNNs) to model relations between knowledge concepts (e.g., GKT).
    • Attention Based Models: Models utilizing self-attention or Transformer architectures (e.g., SAINT, SAKT, AKT, sparseKT-soft, sparseKT-topK, RKT, FoLiBiKT, Dtransformer, stableKT, extraKT, csKT, LefoKT, UKT, MoC-KT, FA-KT).
    • Neural Network (Temporal): Models using Hawkes processes to model temporal cross-effects (e.g., HawkesKT).
  6. Understand MTKT (Multi-granularity Temporal Characteristics)

    main

    MTKT captures multi-granularity temporal characteristics via three components:

    1. Multi-aspect embedding layer: Captures temporal information and interaction behaviors.
    2. Dual attention module with linear decaying bias: Applies negative bias to attention scores to model long-term forgetting.
    3. Causal interaction convolution module: Captures fine-grained representations for both short-term and long-term interactions.
  7. Understand DenoiseKT

    main

    DenoiseKT mitigates attention noise by:

    • Augmenting question representations with question-difficulty and a graph neural network (over question-concept relations).
    • Introducing a denoised attention mechanism that reweights scores via a question-similarity boost factor to suppress cognitively irrelevant interactions.