Skip to content

Abigale001/h2seqrec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

h2seqrec

Paper

Hyperbolic Hypergraphs for Sequential Recommendation
Data and HGCN code

Environment

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

Run steps

  1. Pre-training phase (three contrastive pre-training tasks)
    a. Run pre-training

    python H2SeqRec-Pretrain/run_pretrain.py
    b. Copy the output pre-training embedding to HGCN/data/AMT/use_pretrain/ folder

  2. 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, the HGCN/data/month folder will have 12 csv files, the HGCN/data/quarter folder will have 4 csv files and the HGCN/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. The HGCN/config.py file is the configuration file.
    b. Modify parameters.
    Taking the monthly hyperbolic hypergraph embedding learning as an example, in HGCN/train.py change the pre-training embedding name in line 195, and modify the time_list in line 200. Supposing there are 12 months, the time_list should be range(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.

  3. 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.

  4. Completed Model
    a. Prepare needed data.
    python user_side_hypergraphs_new_hyperbolic_simple.py
    b. Run recommendation.
    python run_total.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages