Hyperbolic Hypergraphs for Sequential Recommendation
Data and HGCN code
Recommendation Environment
python==3.6.12
pytorch==1.9.0
numpy==1.17.5
scikit-learn==0.24.2
scipy==1.5.4
Hyperbolic Hypergraph Neural Network Environment
pytorch==1.0.0
python==3.6.13
-
Pre-training phase (three contrastive pre-training tasks)
a. Run pre-trainingpython H2SeqRec-Pretrain/run_pretrain.py
b. Copy the output pre-training embedding toHGCN/data/AMT/use_pretrain/
folder -
Hierarchical Hyperbolic Hypergraph Neural Network
a. Prepare dataset.
Split the dataset into monthly, quarterly and yearly dataset. For example, if the dataset contains 12 months, theHGCN/data/month
folder will have 12 csv files, theHGCN/data/quarter
folder will have 4 csv files and theHGCN/data/year
folder will have 1 csv file. The format of each line is as follows.node1_id node2_id
. The nodes within each hyperedge are considered connected with each other. TheHGCN/config.py
file is the configuration file.
b. Modify parameters.
Taking the monthly hyperbolic hypergraph embedding learning as an example, inHGCN/train.py
change thepre-training embedding
name in line 195, and modify thetime_list
in line 200. Supposing there are 12 months, thetime_list
should berange(1,13)
.
c. Run hyperbolic hypergraph neural network.
python HGCN/train.py --dataset AMT
P.S. Run monthly, quarterly, yearly hyperbolic hypergraph neural network seperately. The steps are the same, but parameters should be modified. -
User-side Hyperbolic Hypergraph Neural Network
a. Prepare user-side hypergraph dataset.
python create_user_side_hypergraph.py
b. Modify parameters as 2-b.
c. Run hyperbolic hypergraph neural network as 2-c.
P.S. Only monthly is needed. -
Completed Model
a. Prepare needed data.
python user_side_hypergraphs_new_hyperbolic_simple.py
b. Run recommendation.
python run_total.py