premgopalan / hgaprec Goto Github PK
View Code? Open in Web Editor NEWScalable Recommendation with Hierarchical Poisson Factorization P Gopalan, JM Hofman, DM Blei UAI, 326-335
License: GNU General Public License v3.0
Scalable Recommendation with Hierarchical Poisson Factorization P Gopalan, JM Hofman, DM Blei UAI, 326-335
License: GNU General Public License v3.0
Reference --------- @article{DBLP:journals/corr/GopalanHB13, author = {Prem Gopalan and Jake M. Hofman and David M. Blei}, title = {Scalable Recommendation with Poisson Factorization}, journal = {CoRR}, volume = {abs/1311.1704}, year = {2013}, ee = {http://arxiv.org/abs/1311.1704}, bibsource = {DBLP, http://dblp.uni-trier.de} } Installation ------------ Required libraries: gsl, gslblas, pthread On Linux/Unix run ./configure make; make install On Mac OS, the location of the required gsl, gslblas and pthread libraries may need to be specified: ./configure LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include" make; make install The binary 'gaprec' will be installed in /usr/local/bin unless a different prefix is provided to configure. (See INSTALL.) HGAPREC: Hierarchical Gamma Poisson factorization based recommendation tool ---------------------------------------------------------------------------- **hgaprec** [OPTIONS] -dir <string> path to dataset directory with 3 files: train.tsv, test.tsv, validation.tsv (for examples, see example/movielens-1m) -m <int> number of items -n <int> number of users -k <int> number of factors -rfreq <int> assess convergence and compute other stats <int> number of iterations default: 10 -a -b set hyperparameters -c default: a = b = c = d = 0.3 -d -hier learn the hierarchical model with Gamma priors on user and item scale parameters -bias use user and item bias terms -binary-data treat observed data as binary (if rating > 0 then rating is treated as 1) -gen-ranking generate ranking file to use in precision computation; see example -msr write out ranking file assuming the test file is based on leave-one-out, i.e., leaving one item out for each user Example -------- 1. Input data To run inference you need 4 files: {train,test,validation,test_users}.tsv in tab-separated format. See the movielens files in example/ (Additional files are generated from these basic files during evaluation. More on this later.) 2. Running the command You can run "hgaprec" directly or using the scripts/run.pl Perl script. Since hgaprec has numerous options, the perl script is recommended. To setup the Perl script, do the following: a. Set the "$dataloc" variable to the location of the data set directory. For example, for the movielens data, $dataloc = "/n/fs/example/movielens"; b. Set the location of the installed hgaprec binary. For example, $gapbin = "/n/fs/bin/hgaprec"; c. Run the script in one of the following ways: (fit the hierarchical model, i.e., HPF) <path-to>/scripts/run.pl -dataset movielens -hier (fit HPF to data treated as binary) <path-to>/scripts/run.pl -dataset movielens -hier -binary (fit the non-hierarchical model, i.e., BPF to data and treat data as binary) <path-to>/scripts/run.pl -dataset movielens -binary (fit the non-hierarchical model with user, item bias terms, i.e., BPF+bias to data) <path-to>/scripts/run.pl -dataset movielens -bias (fit the non-hierarchical model with user, item bias terms, i.e., BPF+bias to data treated as binary) <path-to>/scripts/run.pl -dataset movielens -bias -binary d. Additional options to the Perl script -K <integer>: set the latent dimensions K -label <string>: set a label for the output directory -seed <integer>: set the pseudo-random number generator seed -logl: compute ELBO every X iterations (expensive!)
I ran the code and got a file itemrank.txt. Most of the third column of numbers, which denoted the prediction ranking, were 0.xxx; some of them were 1.xxx and 2.xxx; just little of them were 3.xxx and 4.xxx. Is it normal in your consumption? Should the prediction score range 1 to 5?
I am trying to run the code by setting up the Perl code. As the comments in the run.pl said:
set the "prefix" path for the data sets
e.g., if data set resides in /scratch/pgopalan/kdd3/example/movielens
set as follows
my $dataloc = "/scratch/pgopalan/hgaprec/analysis/data";
(1)I am confused by this one. What should I set the address of the dataloc if I, say, put the data on
"/Users/yobichi/Downloads/hgaprec-master/example/movielens"? By the way, should I set the dataloc variable in run.pl?
(2) The link: http://jmh-recs.cloudapp.net/home/pgopalan/KDD/output, where the readme.txt of output data can not be opened. Where can I see the format of input and out data to get a clearer understanding?
Hello there,
I am really excited to test the software. I work on mutational processes in cancer and the model has some of the properties I need.
I wonder if you could help by clarifying the input and output formats. I managed to install and run the example, but don't fully understand the formats. Would you help by pointing me to a description of the input and all the files that the program outputs? I am mostly interested in exploring the components, a bit like you did with the movie preferences in the article, and trying to understand common themes.
Kind regards
Dominik
How do you install hgaprec on Mac OS X?
(I'm opening this as a separate issue in case it helps somebody. Answer below.)
I store the yelp data(train.tsv, test.tsv, validation.tsv, test_user.tsv) at /Users/yobichi/Downloads/code_RecSys13/ so I set the
$dataloc = "/Users/yobichi/Downloads/code_RecSys13" at run.pl
and then I run "/Users/yobichi/Downloads/hgaprec-master/scripts/run.pl -dataset yelp_data -hier " in command.
There was an tricky error: cannot open file /Users/yobichi/Downloads/hgaprec-master/example/netflix.
What should I do? Thank you very much.
should there really be both?
wiggins@tantanmen{hgaprec}48: diff README README.md
17c17
The binary 'gaprec' will be installed in /usr/local/bin unless a
20,21c20,21
< HGAPREC: Hierarchical Gamma Poisson factorization based recommendation tool< ----------------------------------------------------------------------------
GAPREC: Gamma Poisson factorization based recommendation tool
23c23
< hgaprec [OPTIONS]
gaprec [OPTIONS]
62c62< (1) ../src/hgaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10
(1) ../src/gaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10
88,93c88,90
< ../src/hgaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -hier
< ../src/hgaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -bias
< ../src/hgaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -binary-data
< ../src/hgaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -binary-data -bias
< ../src/hgaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -hier -bias -binary-data< ... and so on
../src/gaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -bias
../src/gaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -binary-data
../src/gaprec -dir ../example/movielens -n 6040 -m 3900 -k 100 -rfreq 10 -binary-data -bias
wiggins@tantanmen{hgaprec}49:
I tried to install this on both ubuntu and mac os computers, but I always get this error when executing "make":
Making all in src
make[1]: Entering directory /home/dlmocdm/hgaprec-master2/src' source='ratings.cc' object='ratings.o' libtool=no \ DEPDIR=.deps depmode=none /bin/bash ../depcomp \ g++ -DPACKAGE_NAME=\"hgaprec\" -DPACKAGE_TARNAME=\"hgaprec\" -DPACKAGE_VERSION=\"0.1\" -DPACKAGE_STRING=\"hgaprec\ 0.1\" -DPACKAGE_BUGREPORT=\"[email protected]\" -DPACKAGE=\"hgaprec\" -DVERSION=\"0.1\" -DHAVE_LIBGSLCBLAS=1 -DHAVE_LIBPTHREAD=1 -DHAVE_LIBGSL=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDINT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE__BOOL=1 -DHAVE_STDBOOL_H=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MEMSET=1 -DHAVE_MKDIR=1 -DHAVE_STRERROR=1 -DHAVE_STRTOL=1 -I. -I/opt/local/include -O3 -c -o ratings.o ratings.cc /bin/bash: ../depcomp: No such file or directory make[1]: *** [ratings.o] Error 127 make[1]: Leaving directory
/home/dlmocdm/hgaprec-master2/src'
make: *** [all-recursive] Error 1
Any idea how can I solve this?
Thanks!
depcomp is a soft link to a file that might not exist on user's system.
Hi, in the paper, you compute a simulated ratings vector for each user by spreading a preference budget b across k components. Is that code available here? Having a beta[i][k] matrix would be super useful too if I wanted to use it for other discrepancy functions! Thanks so much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.