BiksUP is an ablation study conducted on the SR-GNN model in order to find a superior mode, with scalability in focus.
The work has been conducted by a group of 7th semester students at Aalborg University.
The following project is an ablation study based on the work by Wu et al in 'Session-based Recommendation with Graph Neural Networks' found here.
The ablation study has has been made on the codebase from github.
The code can be run on two datasets, who should be placed in the folder datasets/. The datasets are as following:
There is a small dataset sample included in the folder datasets/, which can be used to test the correctness of the code.
For additional information from the authers of the original paper, a blog was written to explain the paper.
You need to run the file datasets/preprocess.py first to preprocess the data.
For example: cd datasets; python preprocess.py --dataset=sample
usage: preprocess.py [-h] [--dataset DATASET]
optional arguments:
-h, --help show this help message and exit
--dataset DATASET dataset name: diginetica/yoochoose/sampleThen you can run the file pytorch_code/main.py or tensorflow_code/main.py to train the model.
For example: cd pytorch_code; python main.py --dataset=sample
You can add the suffix --nonhybrid to use the global preference of a session graph to recommend instead of the hybrid preference.
You can also change other parameters according to the usage:
usage main.py [-h] [--dataset DATASET [DATASET ...]] [--batchSize BATCHSIZE] [--hiddenSize HIDDENSIZE]
[--epoch EPOCH] [--lr LR] [--lr_dc LR_DC] [--lr_dc_step LR_DC_STEP] [--l2 L2] [--step STEP]
[--patience PATIENCE] [--nonhybrid] [--validation] [--valid_portion VALID_PORTION]
[--keys KEYS [KEYS ...]] [--runall RUNALL] [--runlast RUNLAST] [--iterations ITERATIONS]
[--big_o BIG_O] [--exp_graph EXP_GRAPH]
optional arguments:
-h, --help show this help message and exit
--dataset DATASET [DATASET ...]
dataset name: diginetica/yoochoose1_4/yoochoose1_64/sample
--batchSize BATCHSIZE
input batch size
--hiddenSize HIDDENSIZE
hidden state size
--epoch EPOCH the number of epochs to train for
--lr LR learning rate
--lr_dc LR_DC learning rate decay rate
--lr_dc_step LR_DC_STEP
the number of steps after which the learning rate decay
--l2 L2 l2 penalty
--step STEP gnn propogation steps
--patience PATIENCE the number of epoch to wait before early stop
--nonhybrid only use the global preference to predict
--validation validation
--valid_portion VALID_PORTION
split the portion of training set as validation set
--keys KEYS [KEYS ...]
List of boolean keys of what permutation to execute, '1' = True, '0'=False, '_' = True and
False. Example: ['1110_00']
--runall RUNALL Run all permutations of key combinations
--runlast RUNLAST Run the last executed variation of the --keys argument
--iterations ITERATIONS
How many times the experiments should run
--big_o BIG_O Find the complexity with one key and one dataset
--exp_graph EXP_GRAPH
Run the exponential graph experiment, Default='False'- Python 3
- PyTorch 0.4.0 or Tensorflow 1.9.0
There are other implementation available for reference:
- Implementation based on PaddlePaddle by Baidu [Link]
- Implementation based on PyTorch Geometric [Link]
- Another implementation based on Tensorflow [Link]
- Yet another implementation based on Tensorflow [Link]
Please cite our paper if you use the code:
@inproceedings{biksup:2021,
title = {{Improving the Scalability of Session-Recommendation Systems}},
author = {Roni Horo, Mads H. Kusk, Jeppe J. Holt, Bjarke S. Baltzersen, Milad Samim and Jamie B. Pedersen},
year = 2021,
location = {Aalborg, DK},
month = dec,
pages = {346--353},
url = {https://aaai.org/ojs/index.php/AAAI/article/view/3804},
editor = {Peter Dolog},
}