pymc-devs / pymc-devs/pymc-examples
Unused prior in Bayesian AB testing case study
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 398
- Forks
- 325
- Avg merge
- 9d 15m
- Merged PRs (30d)
- 1
Description
Notebook title: What is A/B testing?
Notebook url: https://github.com/pymc-devs/pymc-examples/blob/main/examples/case_studies/bayesian_ab_testing.ipynb
Issue description
In the RevenueModel class the converted object goes unused:
converted = pm.Binomial(
"converted", n=visitors, p=theta, observed=purchased, shape=num_variants
)
revenue = pm.Gamma(
"revenue", alpha=purchased, beta=lam, observed=total_revenue, shape=num_variants
)
The following line uses purchased (which is supposed to represent collected data) as alpha - I'm guessing that should be converted?
Expected output
I'm a beginner Bayesian, so I'm not sure if the output is unexpected or not.
Proposed solution
In a local copy of the code, I replaced purchased with converted + 1e-8 (plus a small epsilon) in the revenue prior, and the code ran pretty much the same as before.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open examples/case_studies/bayesian_ab_testing.ipynb and locate the RevenueModel class. Inspect how converted, purchased, and total_revenue are used, then run the notebook to compare the current behavior with any change. Done means resolving the unused converted object or documenting why the current revenue prior is correct, with the notebook still running successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- jupyter-notebook, python
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100