PyTorch implementations of collaborative filtering methods with implicit feedback
The implemented methods are as follows:
- BPR, BPR: Bayesian Personalized Ranking from Implicit Feedback, UAI'09
- CML, Collaborative Metric Learning, WWW'17
- MLP, Neural Collaborative Filtering, WWW'17
- NeuMF, Neural Collaborative Filtering, WWW'17
- CDAE, Collaborative Denoising Auto-Encoders for Top-N Recommender Systems, WSDM'16
We provide the leave-one-out evaluation protocol widely used in recent research papers. The protocol is as follows:
- For each test user
- randomly sample two positive (observed) items
- each of them is used for test/validation purpose.
- randomly sample 499 negative (unobserved) items
- evaluate how well each method can rank the test item higher than these sampled negative items.
- randomly sample two positive (observed) items
We provide three ranking metrics broadly adopted in many recent papers: HR@N, NDCG@N, MRR@N. The hit ratio simply measures whether the test item is present in the top-N list, which is defined as follows:
where δ is the indicator function, Utest is the set of the test users, pu is the hit ranking position of the test item for the user u. On the other hand, the normalized discounted cumulative gain and the mean reciprocal rank are ranking position-aware metrics that put higher scores to the hits at upper ranks. N@N and M@N are defined as follows:
A. For BPR, CML, MLP, NeuMF, simply run "main.py"
B. For CDAE, simply run "main_AE.py"