Skip to content

AlexAndorra/pollsposition_blog

Repository files navigation

https://alexandorra.github.io/pollsposition_blog/

PollsPosition — The Blog

This website is a collection of tutorials detailing the Bayesian statistical models used to forecast French elections at the PollsPosition project. The corresponding interactive dashboards can be found here.

What is it?

The models are open-sourced and stand on the shoulders of giants of the Python data stack: PyMC3 for state-of-the-art MCMC algorithms, ArviZ and Bokeh for visualizations, and Pandas for data cleaning.

More details about the project and website are available here.

We warmly thank all the developers who give their time to develop these free, open-source and high quality scientific tools -- just like The Avengers, they really are true heroes.

Who is it?

This project and is maintained and spearheaded by Alexandre Andorra, with the brilliant help of Alexis Bergès.

By day, I'm a Bayesian modeler at the PyMC Labs consultancy and host the most popular podcast dedicated to Bayesian inference out there -- aka Learning Bayesian Statistics.

By night, I don't (yet) fight crime, but I'm an open-source enthusiast and core contributor to the awesome Python packages PyMC and ArviZ.

An always-learning statistician, I love building models and studying elections and human behavior. I also love Nutella a bit too much, but I don't like talking about it – I prefer eating it 😋

Feel free to reach out on Twitter if you want to talk about chocolate, statistical modeling under certainty, or how "polls are useless now because they missed two elections in a row!" -- yeah, I'm a bit sarcastic.

Wanna run the code locally, you daredevil?

Each notebook contains a link to Binder and Google Collab for you to run the code, but if you absolutely want to do that locally, the notebooks are in the _notebooks repository (yeah, I also was surprised at how apt this name is!) and the packages to install are in environment.yml.

We're using PyMC3, which uses Theano-PyMC, which needs C compilers, so we strongly recommend using Anaconda instead of pip to create your environments. Once Anaconda is installed on your computer, use the terminal and go to the root of this repository. Then, follow the following steps (still in the terminal):

  • Create the environment from the environment.yml file: conda env create -f environment.yml
  • The first line of the yml file sets the new environment's name (here, pp-blog)
  • Activate the new environment: conda activate pp-blog
  • Verify that the new environment was installed correctly: conda env list
  • If you want to run the notebooks, you have to tell Jupyter about this new environment. Still on the terminal and with the virtual env activated, just do: python -m ipykernel install --user --name pp-blog
  • Now, just type jupyter lab if you want to launch and run the notebooks.

On that note, go forth and PyMCheers 🖖

About

A collection of tutorials detailing the electoral forecasting models used at PollsPosition.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published