pymc-labs / pymc-marketing

Bayesian marketing toolbox in PyMC. Media Mix (MMM), customer lifetime value (CLV), buy-till-you-die (BTYD) models and more.
https://www.pymc-marketing.io/
Apache License 2.0
663 stars 183 forks source link

`BetaGeoBetaBinomModel` Testing Speedup #1039

Closed ColtAllen closed 1 week ago

ColtAllen commented 1 week ago

Description

The slow test test_model_convergence for the recently added BetaGeoBetaBinomModel takes over 90 minutes in the CI for the following reasons:

Merging https://github.com/pymc-labs/pymc-marketing/pull/707 will make MCMC sampling 3x faster, and although the full test dataset is still required elsewhere so that tests match research results and lifetimes outputs, for this particular slow test we can get away with a smaller dataset.

test_model_convergence is now being ran on a dataframe of 1k rows sampled from the full dataset. I had to bump up the rtol from 0.1 to 0.3 so that it passes, but added a comment the test did previously pass with the full dataset.

Related Issue

Checklist

Modules affected

Type of change


📚 Documentation preview 📚: https://pymc-marketing--1039.org.readthedocs.build/en/1039/

juanitorduz commented 1 week ago

Thanks @ColtAllen !