This repository contains my implementations of DREAM for next basket prediction.
- Python 3.6
- Pytorch 1.6.0
- Pandas 1.1.2
- Sklearn 0.19.1
- Numpy 1.16.2
- Gensim 3.5.0
- Tqdm 4.49.0
You can download the Negative Sample (neg_sample.pickle) used in code. Make sure they are under the /data
folder.
See data format in data
folder which including the data sample files.
This repository can be used in other e-commerce datasets in two ways:
- Modify your datasets into the same format of the sample.
- Modify the data preprocess code in
data_helpers.py
.
Anyway, it should depend on what your data and task are.
DREAM uses RNN to capture sequential information of users' shopping behavior. It extracts users' dynamic representations and scores user-item pair by calculating inner products between users' dynamic representations and items' embedding.
The framework of DREAM:
- Pooling operation on the items in a basket to get the representation of the basket.
- The input layer comprises a series of basket representations of a user.
- The dynamic representation of the user can be obtained in the hidden layer.
- The output layer shows scores of this user towards all items.
References:
Yu, Feng, et al. "A dynamic recurrent model for next basket recommendation." Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval. ACM, 2016.
黄威,Randolph
SCU SE Bachelor; USTC CS Ph.D.
Email: [email protected]
My Blog: randolph.pro
LinkedIn: randolph's linkedin