This is the expreimental code for the paper :
	Hsiang-Fu Yu, Mikhail Bilenko, and Chih-Jen Len. Selection of Negative Samples for One-class Matrix Factorization, 2016

Please cite the paper for the usage of this experimental code. 


Data Preparation 
================

  - run the following command in a shell
  	$cd data/mat-data; ./get-data.sh; cd ../../ 
	
	Note that the pre-processed data sets of netflix and yahoo are available upon request. Please contact Chih-Jen Lin (cjlin AT csie.ntu.edu.tw). 

  - See README inside data/txt-data about how to generate txt-format data.
    This is required for exp-bpr and exp-timing

Install
=======
There are two steps:
  - run the following command in a shell.
	$ make 

  - run the following command in a Matlab shell
  	$ set_env
	

Experiments 
===========
	exp-full-subsampled-ens/
		Open a Matab shell
		>> addpath('../libpmf-1.6/matlab')
		>> load('mat-data/delicious-oc2') % replace delicious by ml1m/ml10m/netflix/yahoo
		>> result = run_exp(oc2)
	    >> print_best(get_best(result));

	exp-bpr/
		Inside a shell
	    $ ./run-bpr.py txt-data/delicious-oc2 # replace delicious by ml1m/ml10m/netflix/yahoo

		Open a Matlab shell
		>> addpath('../libpmf-1.6/matlab')
		>> result = get_bpr_result('delicious'); % replace delicious by ml1m/ml10m/netflix/yahoo
		
	exp-timimg/
		Inside a shell
		$ ./run.sh
		$ ./draw-compare-obj.py

	exp-alpha/
		Open a Matlab shell
		>> addpath('../libpmf-1.6/matlab')
		>> result = alpha_exp(500,500); % replace 500 to 1000
		>> alpha_gen_logs(result, 'final500'); replace 500 to 1000

		Inside a shell
		$ ./draw-compare-alpha.py

