Giter Club home page Giter Club logo

pymc3_vs_pystan's Introduction

Jonathan Sedar Personal Project

PyMC3 Vs PyStan Comparison

Spring 2016

This set of Notebooks and scripts comprise the pymc3_vs_pystan personal project by Jonathan Sedar of Applied AI Ltd, written primarily for presentation at the PyData London 2016 Conference.

The project demonstrates hierarchical linear regression using two Bayesian inference frameworks: PyMC3 and PyStan. The project borrows heavily from code written for Applied AI Ltd and is supplied here for educational purposes only. No copyright or license is extended to users.

Copyright Applied AI Ltd 2016


Development

Git clone the repo to your workspace.

e.g. in Mac OSX terminal:

    $> git clone https://github.com/jonsedar/pymc3_vs_pystan.git
    $> cd pymc3_vs_pystan

NOTES:

  • This project uses Python 3.5, and was developed on a Macbook Pro OSX 10.10.5 using the Anaconda distro with a new virtualenv on 19 April 2016
  • The project requires PyMC3 (with an associated Theano install) and PyStan (with an associated Stan install) so is quite heavy.
  • Specific versions of key packages for clarity: pymc3-3.0, theano-0.8.1, pystan-2.9.0.0

Setup a virtual environment for Python libraries

  1. Using create a new virtualenv, installing packages from env YAML file:

     $> conda env create --file conda_env_pymc3_vs_pystan.yml
     $> source activate pymc3_vs_pystan
    
  2. install remaining packages via pip (inc pymc3 master with deps):

     $> ./pip_install.sh
    
  3. Launch Jupyter Notebook server

     $> jupyter notebook
    

Data

Local data is not stored in the repo, and should be manually copied into the subdirectory data/

See file data/README_DATA.md for more info


General Notes:

File hack_findmap.py contains a customised find_MAP() function to correct for pymc3's default behaviour of computing gradients when the chosen optimizer doesn't use them. We don't want to compute gradients in large datasets because it's quite computationally expensive.

pymc3_vs_pystan's People

Contributors

jonsedar avatar volodymyrk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.