Exploring Bayesian Survival Analysis with PyMC — A GSoC 2026 Introduction
Hi everyone, I’m a Taiwo Oloko, a Statistician with a background in machine learning and data science. I’m interested in contributing to PyMC for GSoC 2026, and I wanted to share a project I built recently to get familiar with the codebase.
What I Tried
I built a Bayesian survival analysis notebook to model customer churn using the IBM Telco dataset. The idea was to treat churn not as a simple yes/no classification problem, but as a time-to-event problem i.e predicting how long a customer stays before leaving, not just whether they leave.
I implemented three models from scratch using PyMC:
-
An Exponential model as a baseline, assuming constant churn risk over time
-
A Weibull model to allow churn risk to change with tenure
-
A Cox Proportional Hazards model to measure how specific factors; contract type, monthly charges, tech support affect churn risk
I compared all three models using WAIC and LOO cross-validation through ArviZ.
What I Learned
The biggest thing I learned is how to handle censored observations in a Bayesian framework. In standard classification, customers who haven’t churned yet are just labelled “No.” But in survival analysis, they carry real information; we know they survived at least this long. I used pm.Potential to add their log-survival contribution directly to the likelihood, which is the correct way to handle this.
I also got comfortable reading posterior distributions properly; not just looking at the mean, but checking credible intervals, trace plots, and R-hat values to make sure the chains actually converged.
From the Cox model, the results made business sense: longer contracts strongly protect against churn, higher charges increase risk, and tech support reduces it. The Weibull shape parameter came out less than 1, meaning churn risk is actually highest early in a customer’s life and decreases over time.
Question:
Please may I have the template that I can use for the proposal
Here is my GitHub link: https://github.com/Evthag/Bayesian-customer-churn-survival-analysis
Happy to get feedback from the community on the survival analysis approach or the improvement idea.