/DropoutNet

Python + TensorFlow implementation of the DropoutNet model

Primary LanguagePython

DropoutNet

Python + TensorFlow implementation of the DropoutNet - a deep neural network model for cold start in recommender systems.

Authors: Maksims Volkovs, Guangwei Yu, Tomi Poutanen

Disclaimer

This repository is just a fork of the original repo which now is not accessible by the public. Please use it at your full responsibility.

Table of Contents

  1. Introduction
  2. Environment
  3. Dataset
  4. Training

This repository contains full implementation of the DropoutNet model and includes both training and evaluation routines. We also provide the ACM RecSys 2017 Challenge dataset that we further split into three subsets for warm start, user cold start and item cold start evaluation. The aim is to train a single model that can be applied to all three tasks and we report validation accuracy on each task during training. If you use this model in your research please cite this paper:

@inproceedings{Volkovs2017,
	author = {Maksims Volkovs and Guangwei Yu and Tomi Poutanen},
	title = {DropoutNet: {Addressing} Cold Start in Recommender Systems},
	booktitle = {Neural Information Processing Systems},
	year = {2017}
}

and also this paper if you use the RecSys dataset:

@inproceedings{Abel2017,
	author = {Fabian Abel and Yashar Deldjoo and Mehdi Elahi and Daniel Kohlsdorf},
	title = {RecSys Challenge 2017: {Offline} and Online Evaluation},
	booktitle = {ACM Conference on Recommender Systems},
	year = {2017}
}

The python code is developed and tested on the following environment:

  • python 2.7
  • tensorflow-gpu 1.3.0
  • Intel Xeon E5-2630
  • 128 GB ram (need about 30)
  • Titan X (Pascal) 12gb, driver ver. 384.81
  • CUDA 9 and CUDNN 7

To run the model, download the dataset from here. With this dataset we have also included a pre-trained Weighted Factorization model (WMF)[Hu et al., 2008], that is used as preference input to DropoutNet. WMF produces competitive performance on warm start but doesn't generalize to cold start. So this code demonstrates how to apply DropoutNet to provide cold start capability to WMF. The format of the data is as follows:

recsys2017.pub				
└─ eval					// use path to this folder in --data-dir
   ├─ trained				// WMF model
   │  └─ warm				
   │     ├─ U.csv.bin			// numpy binarized WMF user preference latent vectors (U)
   │     └─ V.csv.bin			// numpy binarized WMF item preference latent vectors (V)
   ├─ warm				
   │  ├─ test_cold_item.csv		// validation interactions for item cold start 
   │  ├─ test_cold_item_item_ids.csv	// targets item ids for item cold start
   │  ├─ test_cold_user.csv    		// validation interactions for user cold start
   │  ├─ test_cold_user_item_ids.csv	// target user ids for user cold start
   │  ├─ test_warm.csv			// validation interactions for warm start
   │  ├─ test_warm_item_ids.csv		// target item ids for warm start
   │  └─ train.csv			// training interactions
   ├─ item_features_0based.txt		// item features in libsvm format
   └─ user_features_0based.txt		// user features in libsvm format
      
interactions are stored in csv as:
  <USER_ID>,<ITEM_ID>,<INTERACTION_TYPE>,<TIMESTAMP>
where INTERACTION_TYPE is one of:
  0: impression
  1: click
  2: bookmark
  3: reply
  5: recruiter interest
  1. Download dataset above, extract and keep the directory structure.

  2. run main.py

    • for usage, run with main.py --help
    • default setting trains a two layer neural network with hyperparameters selected for the RecSys data
    • gpu is used for training by default and cpu for inference
  3. (Optionally) launch tensorboard to monitor progress by tensorboard --logdir=<log_path>

During training recall@50,100,...,500 accuracy is shown every 50K updates for warm start, user cold start and item cold start validation sets.

Notes:

  • Make sure --data-dir points to the eval/ folder, not the root
  • On our environment (described above) 50K updates takes approximately 14 minutes with the default GPU/CPU setting.
  • By default, training happens on GPU while inference and batch generation is on CPU.