The repository implement the Adversarial Personalized Ranking for Recommendation with PyTorch.
Although the overall performance still needs to be adjusted, it can be seen that the model's performance has been significantly improved after the adversarial training began(at epoch1500).
- python==3.6
- pytorch==1.3.1
You can install these package by executing the following command or through anaconda.
pip install -r requirements.txt
In order to better compare with the experimental effect of the original author, this repository adopted the processed datasets provided in the authors' source code. The processed dataset are:
- MovieLens 1M
- Yelp
Execute following command line to preprocess the data.
python3.6 preprocess.py --dataset ml-1m --output_data preprocessed/ml-1m.pickle
python3.6 preprocess.py --dataset yelp --output_data preprocessed/yelp.pickle
python3.6 preprocess.py --dataset pinterest --output_data preprocessed/pinterest.pickle
python3.6 train.py --data preprocessed/ml-1m.pickle
python3.6 train.py --data preprocessed/yelp.pickle
python3.6 train.py --data preprocessed/pinterest.pickle
The result was evaluated by Hit Ratio (HR) and Normalized Discounted Cumulative Gain (NDCG).