Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified Beta Geometric model #1301

Merged
merged 25 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d480c2b
Modified Beta Geometric model
PabloRoque Dec 19, 2024
efa1d04
Run pre-commit, skipping mypy unrelated errors
PabloRoque Dec 19, 2024
645f1fa
Fix convergence tests and add _model_type
PabloRoque Dec 19, 2024
6d3301c
Add ModBetaGeoModel to __all__
PabloRoque Dec 19, 2024
59e7722
Delete L81-82 comment on likelihood refactor
PabloRoque Dec 20, 2024
3cc020c
MBG tests coefficients match those of lifetimes
PabloRoque Dec 20, 2024
a993465
Delete test_numerically_stable_logp
PabloRoque Dec 20, 2024
7e1f364
Parametrize test_missing_cols
PabloRoque Dec 20, 2024
8b47ff3
Rename ModBetaGeoModel -> ModifiedBetaGeoModel
PabloRoque Dec 20, 2024
632ae67
Add MBG/NBD notebook
PabloRoque Dec 20, 2024
291f28d
Update paper reference to MBG/NBD model in docs/source/notebooks/clv/…
PabloRoque Dec 20, 2024
7101f80
Improve ModifiedBetaGeoModel docstring
PabloRoque Dec 20, 2024
a15a8d7
Updated expected_purchases docstring
PabloRoque Dec 20, 2024
2476268
Update expected_probability_alive doctring
PabloRoque Dec 20, 2024
c868668
Update expected_purchases_new_customer docstring
PabloRoque Dec 20, 2024
1ca5a9a
Mode dataframe definition out of with-block in test_customer_id_dupli…
PabloRoque Dec 20, 2024
3a30fc3
Reduce rtol in model convergence test
PabloRoque Dec 20, 2024
1b13a12
Raise NotImplementedError in ModifiedBetaGeoModel.expected_probabilit…
PabloRoque Dec 20, 2024
56e8ac0
Add Weibull Prior to notebook
PabloRoque Dec 20, 2024
208e4f9
Add expected_probability_no_purchase function signature. Remove assoc…
PabloRoque Dec 20, 2024
473616f
Merge branch 'main' into modified-beta-geo
PabloRoque Dec 23, 2024
7a065c6
Add MBG/NBD to clv_quickstart, index.md and README
PabloRoque Dec 23, 2024
2303f82
Remove Weibull priors section in mbg_nbd.ipynb
PabloRoque Dec 23, 2024
5a7ae75
Clear imports cell output
PabloRoque Dec 23, 2024
d494fff
Add MBG/NBD notebook to index.md
PabloRoque Dec 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ Understand and optimize your customer's value with our **CLV models**. Our API s
- [Pareto/NBD model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/pareto_nbd.html)
- [Gamma-Gamma model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/gamma_gamma.html)
- [Shifted Beta-Geo model](https://www.pymc-marketing.io/en/stable/notebooks/clv/sBG.html)
- [Modified BG/NBD model](https//pymc-marketing.readthedocs.io/en/stable/notebooks/clv/mbg_nbd.html)

### Examples

Expand Down
1 change: 1 addition & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ Understand and optimize your customer's value with our **CLV models**. Our API s
- [Pareto/NBD model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/pareto_nbd.html)
- [Gamma-Gamma model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/gamma_gamma.html)
- [Shifted Beta-Geo model](https://www.pymc-marketing.io/en/stable/notebooks/clv/sBG.html)
- [Modified BG/NBD model](https//pymc-marketing.readthedocs.io/en/stable/notebooks/clv/mbg_nbd.html)

Each of these models is tailored to different types of data and business scenarios:

Expand Down
1 change: 1 addition & 0 deletions docs/source/notebooks/clv/clv_quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"* **[BG/BB model](https://www.pymc-marketing.io/en/latest/api/generated/pymc_marketing.clv.models.beta_geo_beta_binom.BetaGeoBetaBinomModel.html)** for discrete time, contractual modeling\n",
"* **Exponential Gamma model** for discrete time, contractual modeling (coming soon)\n",
"* **[Gamma-Gamma model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/gamma_gamma.html)** for expected monetary value\n",
"* **[Modified BG/NBD model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/mbg_nbd.html)**, similar to [BG/NBD model](https://pymc-marketing.readthedocs.io/en/stable/notebooks/clv/bg_nbd.html) but assigning \"drop out\" probability after first purchase\n",
"\n",
"This table contains a breakdown of the four BTYD modeling domains, and examples for each:\n",
"\n",
Expand Down
4,328 changes: 4,328 additions & 0 deletions docs/source/notebooks/clv/mbg_nbd.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/source/notebooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ clv/bg_nbd
clv/gamma_gamma
clv/pareto_nbd
clv/sBG
clv/mbg_nbd
:::

:::{toctree}
Expand Down
2 changes: 2 additions & 0 deletions pymc_marketing/clv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
BetaGeoModel,
GammaGammaModel,
GammaGammaModelIndividual,
ModifiedBetaGeoModel,
ParetoNBDModel,
ShiftedBetaGeoModelIndividual,
)
Expand All @@ -40,6 +41,7 @@
"BetaGeoModel",
"GammaGammaModel",
"GammaGammaModelIndividual",
"ModifiedBetaGeoModel",
"ParetoNBDModel",
"ShiftedBetaGeoModelIndividual",
"customer_lifetime_value",
Expand Down
2 changes: 2 additions & 0 deletions pymc_marketing/clv/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
GammaGammaModel,
GammaGammaModelIndividual,
)
from pymc_marketing.clv.models.modified_beta_geo import ModifiedBetaGeoModel
from pymc_marketing.clv.models.pareto_nbd import ParetoNBDModel
from pymc_marketing.clv.models.shifted_beta_geo import ShiftedBetaGeoModelIndividual

Expand All @@ -30,6 +31,7 @@
"CLVModel",
"GammaGammaModel",
"GammaGammaModelIndividual",
"ModifiedBetaGeoModel",
"ParetoNBDModel",
"ShiftedBetaGeoModelIndividual",
)
Loading
Loading