Skip to content

Commit

Permalink
Adding warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
cetagostini committed Sep 30, 2023
1 parent cef8c86 commit 1c4f093
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pymc_marketing/mmm/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from inspect import (
getattr_static,
isdatadescriptor,
Expand Down Expand Up @@ -485,7 +486,7 @@ def compute_channel_contribution_original_scale(self) -> DataArray:
)

def _estimate_budget_contribution_fit(
self, method: str, channel: str, budget: float
self, channel: str, budget: float, method: str = "sigmoid"
) -> Tuple:
"""
Estimate the lower and upper bounds of the contribution fit for a given channel and budget.
Expand Down Expand Up @@ -614,7 +615,7 @@ def _plot_scenario(
)

def plot_budget_scenearios(
self, *, base_data: Dict, method: str, **kwargs
self, *, base_data: Dict, method: str = "sigmoid", **kwargs
) -> plt.Figure:
"""
Experimental: Plots the budget and contribution bars side by side for multiple scenarios.
Expand Down Expand Up @@ -884,6 +885,8 @@ def optimize_channel_budget_for_maximum_contribution(
"The 'parameters' argument (keyword-only) must be provided and non-empty."
)

warnings.warn("This budget allocator method is experimental", UserWarning)

Check warning on line 888 in pymc_marketing/mmm/base.py

View check run for this annotation

Codecov / codecov/patch

pymc_marketing/mmm/base.py#L888

Added line #L888 was not covered by tests

return budget_allocator(

Check warning on line 890 in pymc_marketing/mmm/base.py

View check run for this annotation

Codecov / codecov/patch

pymc_marketing/mmm/base.py#L890

Added line #L890 was not covered by tests
method=method,
total_budget=total_budget,
Expand All @@ -893,7 +896,7 @@ def optimize_channel_budget_for_maximum_contribution(
)

def compute_channel_curve_optimization_parameters_original_scale(
self, method: str
self, method: str = "sigmoid"
) -> Dict:
"""
Experimental: Estimate the parameters for the saturating function of each channel's contribution.
Expand All @@ -912,6 +915,10 @@ def compute_channel_curve_optimization_parameters_original_scale(
A dictionary where keys are channel names and values are tuples (L, k) representing the
parameters for each channel based on the method used.
"""
warnings.warn(

Check warning on line 918 in pymc_marketing/mmm/base.py

View check run for this annotation

Codecov / codecov/patch

pymc_marketing/mmm/base.py#L918

Added line #L918 was not covered by tests
"The curve optimization parameters method is experimental", UserWarning
)

channel_contributions = self.compute_channel_contribution_original_scale().mean(

Check warning on line 922 in pymc_marketing/mmm/base.py

View check run for this annotation

Codecov / codecov/patch

pymc_marketing/mmm/base.py#L922

Added line #L922 was not covered by tests
["chain", "draw"]
)
Expand Down

0 comments on commit 1c4f093

Please sign in to comment.