Skip to content

ivan-chai/pretpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PreTPP

Build Status License

Advanced pretraining for TPP, MTPP and Event Sequences.

The code is highly dependent on and compatible with HoTPP.

Installation

pip install --no-build-isolation .

HT-Transformer

The code for HT-Transformer can be found at:

pretpp/nn/encoder/history_token_transformer.py
pretpp/nn/encoder/history_token_strategy.py

Data preparation

Some datasets are inherited from HoTPP. For them just make a symlink to the data folder:

cd experiments/DATASET
ln -s <hotpp>/experiments/DATASET/data .

To make datasets, specific to PreTPP, use the following command:

cd experiments/DATASET
spark-submit --driver-memory 16g -c spark.network.timeout=100000s --master 'local[12]' scripts/make-dataset.py

Parameters

All configs are placed at experiments/DATASET/configs.

Results

All results are stored in experiments/DATASET/results.

Usage

Example training of HT-Transformer on the Churn dataset:

cd experiments/transactions-rosbank-full-3s
CUDA_VISIBLE_DEVICES=0 python3 -m hotpp.train_multiseed --config-dir configs --config-name next_item_hts_transformer

Fine-tune:

CUDA_VISIBLE_DEVICES=0 python3 -m hotpp.train_multiseed --config-dir configs --config-name htl_transformer_ft_multi base_name=next_item_hts_transformer

Example training of NTP-Transformer on the Taobao dataset:

cd experiments/taobao
CUDA_VISIBLE_DEVICES=0 python3 -m hotpp.train_multiseed --config-dir configs --config-name next_item_transformer

Fine-tune:

CUDA_VISIBLE_DEVICES=0 python3 -m hotpp.train_multiseed --config-dir configs --config-name transformer_ft_multi base_name=next_item_transformer

Citation

@article{karpukhin2025httransformer,
  title={HT-Transformer: Event Sequences Classification by Accumulating Prefix Information with History Tokens},
  author={Karpukhin, Ivan and Savchenko, Andrey},
  journal={arXiv preprint arXiv:2508.01474v1},
  year={2025},
  url ={https://arxiv.org/abs/2508.01474v1}
}

About

Advanced pretraining for TPP, MTPP and Event Sequences.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages