Git Product home page Git Product logo

pcmc-nips's Introduction

Pairwise Choice Markov Chains (PCMC)

This repository hosts data and code released in conjunction with the following paper:

  • S. Ragain, J. Ugander (2016) "Pairwise Choice Markov Chains", NIPS.

The paper applies the PCMC model to two datasets: SFwork and SFshop. To reproduce the plot for SFwork seen in the paper, simply run infer.py and then plot.py. To average over more or fewer shuffles of the data, or to see more or fewer splits of the training data, or change the dataset, simply edit the top-level script environment at the bottom of infer.py. As written, the plotter plot.py must be updated if there are changes in train/test split.

The code can be run on the SFshop data by commenting in/out 2 lines in the script environment of infer.py, and changing a boolean in the script environment of plot.py. The code is written for python 2.7 and depends on scipy. For scipy, versuib 0.17.0 or later should work, but an earlier version (0.13.0b1) is known to be incompatible because it lacks L-BFGS-B.

Detailed breakdown of files:

  • SFwork.csv, SFshop.csv: CSV files containing the SFwork and SFshop datasets. Each row contains a choice, choice set sample. The index of the choice is followed by 0/1 entries marking whether the choice indexed by that column was in the choice set. The header gives the transportation options represented by each column.

  • worklist.p, shoplist.p: Pickled versions of the SFwork and SFshop data, respectively. The unpickled files are a list of choice-set and selection tuples of the form (S,idx) where S[idx] was chosen from S. The indexing matches the csv files.

  • infer.py: Shuffles and splits the data into training sets and a test set, then infers parameters for MNL, MMNL, and PCMC models and outputs their inferential errors in the form of numpy arrays saved to the local directory.

  • plot.py: Reads in and plots inferential errors prepared by infer.py.

See the following reference for more information:

[1] F. S Koppelman and C. Bhat. A self instructing course in mode choice modeling: multinomial and nested logit models. US Department of Transportation, Federal Transit Administration, 31, 2006.

Any comments, questions, or concerns should be directed to sragain at stanford.edu.

pcmc-nips's People

Contributors

jugander avatar

Watchers

Emaad Manzoor avatar James Cloos 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.