librahu / MCRec

Source code for KDD 2018 paper "Leverage Meta-path based Context for Top-N Recommendation with a Neural Co-Attention Model"
128 stars 49 forks source link

MCRec

Source code for KDD 2018 paper "Leverage Meta-path based Context for Top-N Recommendation with a Neural Co-Attention Model"

Requirements

Reference

@inproceedings{

author = {Binbin Hu, Chuan Shi, Wayne Xin Zhao and Philip S. Yu.},

title = {Leverage Meta-path based Context for Top-N Recommendation with a Neural Co-Attention Model},

booktitle = {Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining},

year = {2018},

url = {https://dl.acm.org/citation.cfm?id=3219965},

publisher = {ACM},

address = {London, United Kingdom},

keywords = {Recommender System, Heterogeneous Information Network, Deep Learning, Attention Mechanism},

}

More Details

Dataset

We provide one processed dataset : MovieLens 100k (ml-100k). For each user, we treat the latest interaction as the test set and remaining data for training. Besides, we randomly select 50 movies that are not interacted by the user and rank the test movie amongst the 50 movies.

train.rating:

test.rating:

test.negative

Metapath Construction

The data we utilize is located in HIN Datasets or you can obtain it by executing the dataProcessing.py.

python dataProcessing.py

Run metapath construction :

The metapathbasedPathSampleForMovielens.py constructs different meta-paths for the following model training.

python metapathbasedPathSampleForMovielens.py --walk_num 5 --metapath umtm

Here,

Output:

Example to run the codes.

The parameter setting is set on line 476-484 of file MCRec, and the dataset for which is Movielens-100K. Be sure to refer to it while experimenting with different datasets.

Run MCRec:

python MCRec.py --dataset ml-100k --epochs 30 --batch_size 256 --learner adam --lr 0.001 --latent_dim 128 --latent_layer_dim [512, 256, 128, 64] --num_neg 4

Remarkable