Abstract: In this tutorial, we explore Bayesian regression using PyMC -- the primary library for Bayesian sampling in Python -- focusing on survey data and other datasets with categorical outcomes. Starting with logistic regression, we’ll build up to categorical and ordered logistic regression, showcasing how Bayesian approaches provide versatile tools for developing and evaluating complex models. Participants will leave with practical skills for implementing Bayesian regression models in PyMC, along with a deeper appreciation for the power of Bayesian inference in real-world data analysis. Participants should be familiar with Python, the SciPy ecosystem, and basic statistics, but no experience with Bayesian methods is required.
Session Outline:
Logistic Regression with PyMC
* Overview of Bayesian inference
* Modeling binary outcomes with logistic regression
* Introduction to PyMC and its capabilities
* Hands-on example: Happiness data in the General Social Survey
Categorical Regression
* Extending logistic regression to multi-class outcomes
* Differences between Bayesian models and GLM
* Hands-on example: Political alignment and party affiliation
Ordered Logistic Regression
* Introduction to ordinal outcomes and their challenges
* Implementing ordered logistic regression in PyMC
* Hands-on example: Analyzing ordered survey responses
Conclusion and Q&A
* Recap of key concepts
* Resources for further learning
* Open discussion and questions
By the end of the session, participants will have hands-on experience with Bayesian regression models in PyMC and a solid understanding of how to apply these techniques to real-world data analysis.
Background Knowledge:
This tutorial is aimed at data scientists who are comfortable with Python, the SciPy ecosystem, and basic statistics but are new to Bayesian statistics and/or PyMC.
Bio: Allen Downey is a curriculum designer at Brilliant.org and professor emeritus at Olin College. He is the author of several books -- including Think Python, Think Bayes, and Probably Overthinking It -- and a blog about data science and Bayesian statistics. He received a Ph.D. in computer science from the University of California, Berkeley; and Bachelor's and Masters degrees from MIT.

Allen Downey, PhD
Title
Principal Data Scientist | PyMC Labs


