06 Feb 2024 This is the Pytorch implementation for "tempLGCN: Time-Aware Collaborative Filtering with Graph Convolutional Networks".
User’s taste evolves, and failing to account for this can lead to less effective recommendations. To tackle this, a novel temporal collaborative filtering model based on a graph convolutional network (GCN) is introduced. This model incorporates long-term and transient temporal signals via relative and absolute time functions, designed to capture the changes in user preferences. Experiments on MovieLens datasets showcase the superiority of this approach over state-of-the-art methods.
pip install -r requirements.txt
We tested on three datasets: MovieLens ml100k and ml1m.
run tempLGCN on ML100k dataset (ml100k is the default dataset):
python main.py
NOTE, here are some key parameters:
-
--model sets the model to run. The options are: 'lgcn' - LightGCN, 'lgcn_b' - LGCN with baseline signal, 'lgcn_b_a' - LGCN with baseline and absolute temporal signals, 'lgcn_b_r' - LGCN with baseline and relative temporal signals, 'lgcn_b_ar' - tempLGCN i.e., the full model including the baseline and absolute and relative temporal signals. The default value: 'lgcn_b_ar'
-
--dataset chooses the dataset to run. The options are: 'ml100k' and 'ml1m'. The default value: 'ml100k'.
-
--batch_size sets the batch size. We chose 95000 for ml100k and 950000 for ml1m making a fullbatch. The default value: 95000.
-
--epochs sets the number of epochs to run. The default value: 991.
-
--layers sets the number of layers for GCN. The default value: 4
-
--decay sets the weight decay. The default value: 1e-05 (please set it to 1e-06 for ml1m)
-
--a_method sets the function for absolute temporal function. The options are: 'exp' and 'log'. The default value: 'log'
-
--r_method sets the function for relative temporal function. The options are: 'exp' and 'log'. The default value: 'exp'
-
--a_beta sets the beta parameter for absolute temporal function. The default value: 0.055
-
--r_beta sets the beta parameter for relative temporal function. The default value: 0.025
-
--epochs_per_eval sets the number of epochs that evalution to be taken per. The default value: 10
-
--emb_dim sets the dimension size of embeddings. The default value: 64.
-
--top_k sets the number of top k value. The default value: 20
- If you want to run tempLGCN on your own dataset, you can just feed any data that has "user item rating timestamp" format and use --dataset parameter to provide the name of your dataset. Datasets are stored in the data subfolder.
RMSE: 0.8877, 0.8861, 0.8870, 0.8865, 0.8869 -> 0.8868
Recall@20: 0.6670, 0.6660, 0.6650, 0.6630, 0.6660 -> 0.6654
Prec@20: 0.6810, 0.6800, 0.6760, 0.6810, 0.6830 -> 0.6802