Skip to content

Adversarial Personalized Ranking for recommendation based on PyTorch framework implementation

Notifications You must be signed in to change notification settings

caoymg/APR-PyTorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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).

Environment

  • 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

Usage

1. Preprocess data

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
  • Pinterest

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

2. Training AMF

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 

3.Evaluation

The result was evaluated by Hit Ratio (HR) and Normalized Discounted Cumulative Gain (NDCG).

About

Adversarial Personalized Ranking for recommendation based on PyTorch framework implementation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages