# The HGN model for Sequential Recommendation
The implementation of the paper:
*Chen Ma, Peng Kang, and Xue Liu, "**Hierarchical Gating Networks for Sequential Recommendation**", in the 25th ACM SIGKDD Conference on Knowledge Discovery and Data Mining (**KDD 2019**)*
Arxiv: https://arxiv.org/abs/1906.09217
**Please cite our paper if you use our code. Thanks!**
Author: Chen Ma (allenmc1230@gmail.com)
**Feel free to send me an email if you have any questions.**
**Bibtex**
```
@inproceedings{DBLP:conf/kdd/MaKL19,
author = {Chen Ma and
Peng Kang and
Xue Liu},
title = {Hierarchical Gating Networks for Sequential Recommendation},
booktitle = {{KDD}},
pages = {825--833},
publisher = {{ACM}},
year = {2019}
}
```
## Environments
- python 3.6
- PyTorch (version: 1.0.0)
- numpy (version: 1.15.0)
- scipy (version: 1.1.0)
- sklearn (version: 0.19.1)
## Dataset
In our experiments, the *movielens-20M* dataset is from https://grouplens.org/datasets/movielens/20m/, the *Amazon-CDs* and *Amazon-Books* datasets are from http://jmcauley.ucsd.edu/data/amazon/, the *GoodReads-Children* and *GoodReads-Comics* datasets are from https://sites.google.com/eng.ucsd.edu/ucsdbookgraph/home. (If you need the data after preprocessing, please ~~send me an email~~ check this [Google Drive link](https://drive.google.com/file/d/1fPTpXFActieWBjowJpAF0YzctFHALCp3/view?usp=sharing)).
The ```XXX_tem_sequences.pkl``` file is a list of lists that stores the inner item id of each user in a chronological order, e.g., ```user_records[0]=[item_id0, item_id1, item_id2,...]```.
The ```XXX_user_mapping.pkl``` file is a list that maps the user inner id to its original id, e.g., ```user_mapping[0]=A2SUAM1J3GNN3B```.
The ```XXX_item_mapping.pkl``` file is similar to ```XXX_user_mapping.pkl```.
## Example to run the code
Data preprocessing:
The code for data preprocessing is put in the ```/preprocessing``` folder. ```Amazon_CDs.ipynb``` provides an example on how to transform the raw data into the ```.pickle``` files that used in our program.
Train and evaluate the model (you are strongly recommended to run the program on a machine with GPU):
```
python run.py
```
## Another implementation
Kindly thank [Liwei Wu](https://github.com/wuliwei9278) for another implementation with a different evaluation strategy: https://github.com/wuliwei9278/HGN_baseline.
## Acknowledgment
The sequence segmentation (interactions.py) is heavily built on [Spotlight](https://github.com/maciejkula/spotlight). Thanks for the amazing work.
用于顺序推荐的分层门控网络_Jupyter Notebook_Python_下载.zip
版权申诉
179 浏览量
2023-04-23
00:21:47
上传
评论
收藏 6.69MB ZIP 举报
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
最新资源
- face-detect.ipynb
- 以下是一些关于ACM(国际大学生程序设计竞赛)、NOI(全国青少年信息学奥林匹克竞赛)以及CSP(全国青少年信息学奥林匹克竞赛提
- 是一些电子设计竞赛(电赛)经验分享,包括备赛策略、项目管理、团队合作和比赛期间的注意事项
- 全能运行库修复工具DirectX Repair v4.1.0.30770
- las格式点云数据使用详解(附VS编译好的LAStools工具)
- KRPano插件一键解密大师1.4.0 (解压密码1234)
- 适用于618节日的销售数据
- 《C++沉思录》是一本由 Scoot Meyers 所著的经典 C++ 编程书籍 该书深入探讨了 C++ 的一些高级概念和技术
- 海信刷机数据 LED42K310X3D(0000)BOM1-C006软件数据与LED42K310NX3D(0000)BOM1通用
- 网卡硬刷MAC地址的工具和教程
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈