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

MMM Case Study from PyData Global #1044

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions docs/source/notebooks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mmm/mmm_time_varying_media_example
mmm/mmm_components
mmm/mmm_roas
mmm/mmm_time_slice_cross_validation
mmm/mmm_case_study
:::

:::{toctree}
Expand Down
6,850 changes: 6,850 additions & 0 deletions docs/source/notebooks/mmm/mmm_case_study.ipynb

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions pymc_marketing/mmm/mmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2131,6 +2131,7 @@ def allocate_budget_to_maximize_response(
custom_constraints: dict[str, float] | None = None,
quantile: float = 0.5,
noise_level: float = 0.01,
**minimize_kwargs,
) -> az.InferenceData:
"""Allocate the given budget to maximize the response over a specified time period.

Expand Down Expand Up @@ -2159,6 +2160,10 @@ def allocate_budget_to_maximize_response(
Custom constraints for the optimization. If None, no custom constraints are applied.
quantile : float, optional
The quantile to use for recovering transformation parameters. Default is 0.5.
noise_level : float
The level of noise added to the allocation strategy (by default 1%).
**minimize_kwargs
Additional arguments to pass to the `BudgetOptimizer`.

Returns
-------
Expand Down Expand Up @@ -2188,6 +2193,7 @@ def allocate_budget_to_maximize_response(
total_budget=budget,
budget_bounds=budget_bounds,
custom_constraints=custom_constraints,
**minimize_kwargs,
)

synth_dataset = self._create_synth_dataset(
Expand Down
Loading