Giter Site home page Giter Site logo

mindis / dynamicpoissonfactorization Goto Github PK

View Code? Open in Web Editor NEW

This project forked from blei-lab/dynamicpoissonfactorization

0.0 2.0 0.0 86.2 MB

Dynamic version of Poisson Factorization (dPF). dPF captures the changing interest of users and the evolution of items over time according to user-item ratings.

License: GNU General Public License v3.0

C++ 100.00%

dynamicpoissonfactorization's Introduction

Dynamic Poisson factorization (dPF)

This repository provides the dynnormprec (Dynamic Normal Poisson factorization) recommendation tool.

Reference

Dynamic Poisson factorization by Laurent Charlin, Rajesh Ranganath, James McInerney and David Blei, Rec'Sys 2015.

Acknowledgements

This code is built from a fork of Prem Gopalan's Poisson factorization code (https://github.com/premgopalan/hgaprec).

Installation

Required libraries: gsl, gslblas, pthread, openMP

On Linux/Unix run

./configure;make

On Mac OS (untested), the location of the required gsl, gslblas, pthread, and openMP libraries may need to be specified:

./configure LDFLAGS="-L/opt/local/lib" CPPFLAGS="-I/opt/local/include"; make

The binary 'dynnormprec' will be installed in /usr/local/bin unless a different prefix is provided to configure. (See INSTALL.)

Running

./dynnormprec -dir data_dir -n num_users -m num_items -k num_factors [-rfreq] [-vprior] [-binary-data]

Required arguments

  • -dir path to dataset directory with 3 files: train.tsv, test.tsv, validation.tsv (for examples, see data/)
  • -n number of users
  • -m number of items
  • -k number of factors

Optional arguments

  • -rfreq assess convergence and compute other stats every number of iterations [default: 10]
  • -vprior set variance hyperparameters [default 10]
  • -non-binary-data treat observed data as non-binary (warning the code is untested w/o this option) [default false]
  • -num_threads set the number of parallel threads to run [default 1]
  • -tpl length of each time period (measured in seconds) [default 6*30 days ~ 6 months]

Example

  1. Input data. To run inference you need 4 files: {train,test,validation,test_users}.tsv in tab-separated format. See the lastFM files in dat/. To use this dataset you will first need to uncompress the data files (e.g., for train.tsv.gz gunzip train.tsv.gz and similarly with validation.tsv.gz and test.tsv.gz)

  2. Running the command. We recommend running dynnormprec using the following options:

./src/dynnormprec -n 992 -m 983 -dir dat/ -k 5 -rfreq 10 -vprior 10 -num_threads TH;

  • TH is the number of available CPUs on the machine.
  • Changing the number of factors and the variance hyperparameters will have an effect on the quality of the resulting model.

dynamicpoissonfactorization's People

Contributors

lcharlin avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.