Implementation of A Neural Collaborative Filtering Model with Interaction-based Neighborhood (NNCF)
Ting Bai et al. "A Neural Collaborative Filtering Model with Interaction-based Neighborhood." Proceedings of the 2017 ACM on Conference on Information and Knowledge Management. ACM, 2017.
Parameters(see main.py: the optimazation parameters):
neigh_sample_num: the maximum neighbors in our algorithm
neg_num: the number of negative samples in training
embed_size: the dimension of embedding
hidden_size: the dimension of MLP layer
epoch: training epoch
dropout: Parameters of the dropout function
lr: learning rate
l2: wight_decay
conv_kernel_size: the size of convolution
pool_kernel_size: the size of pooling
patience: early stopping
utils.py: Define data loading function, loss function, evaluation function
preprocess.py: Preprocess the original data set to generate train.csv銆乨ev.csv銆乼est.csv
model.py: Define the model NNCF
neigh.py: Get neighbor information of a node (Louvain or Direct)
main.py: Entrance of the entire program
The python files are independent to make our project more flexible and extensible. You can tuning parameters and run the corresponding python file that you need.
Python version: 3.8.5
Pytorch version: 1.5.1
community: 0.14
networkx: 2.4
| Dataset | HR@5 | NDCG@5 | HR@10 | NDCG@10 |
|---|---|---|---|---|
| ml-100k | 0.4355 | 0.4323 | 0.4447 | 0.4352 |
Please cite our paper if you use this code in your own work:
@inproceedings{bai2017neural,
title={A neural collaborative filtering model with interaction-based neighborhood},
author={Bai, Ting and Wen, Ji-Rong and Zhang, Jun and Zhao, Wayne Xin},
booktitle={Proceedings of the 2017 ACM on Conference on Information and Knowledge Management},
pages={1979--1982},
year={2017},
organization={ACM}
}