From 1c4f09351a110a1077a6372f74d35f95257822c3 Mon Sep 17 00:00:00 2001 From: Carlos Trujillo <59846724+carlangastr@users.noreply.github.com> Date: Sat, 30 Sep 2023 19:33:15 +0000 Subject: [PATCH] Adding warnings. --- pymc_marketing/mmm/base.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pymc_marketing/mmm/base.py b/pymc_marketing/mmm/base.py index 7df781df..72267cc4 100644 --- a/pymc_marketing/mmm/base.py +++ b/pymc_marketing/mmm/base.py @@ -1,3 +1,4 @@ +import warnings from inspect import ( getattr_static, isdatadescriptor, @@ -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. @@ -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. @@ -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) + return budget_allocator( method=method, total_budget=total_budget, @@ -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. @@ -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( + "The curve optimization parameters method is experimental", UserWarning + ) + channel_contributions = self.compute_channel_contribution_original_scale().mean( ["chain", "draw"] )