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
    (if you cannot compile successfully, please use ``make'' command in the dir ``./libpmf-1.6/matlab/''.)

Experiments 
===========
    exp-bpr/
        Inside a shell
        $ sh run_bpr_all.sh

    exp-Table4/
        You need to train the bpr results first.
            Open a Matab shell
        >> show_Table_4();
        
    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

