From 514fbb4231d6c723432874109cd84ed5053cf016 Mon Sep 17 00:00:00 2001 From: Maxim Kochurov Date: Wed, 24 Jul 2024 13:38:39 +0300 Subject: [PATCH 1/3] Update docs in transformers.py docs: Fix the docstring --- pymc_marketing/mmm/transformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymc_marketing/mmm/transformers.py b/pymc_marketing/mmm/transformers.py index 58fa6c50b..82b55323e 100644 --- a/pymc_marketing/mmm/transformers.py +++ b/pymc_marketing/mmm/transformers.py @@ -79,7 +79,7 @@ def batched_convolution( The axis of ``x`` along witch to apply the convolution mode : ConvMode, optional The convolution mode determines how the convolution is applied at the boundaries - of the input signal, denoted as "x." The default mode is ConvMode.Before. + of the input signal, denoted as "x." The default mode is ConvMode.After. - ConvMode.After: Applies the convolution with the "Adstock" effect, resulting in a trailing decay effect. - ConvMode.Before: Applies the convolution with the "Excitement" effect, creating a leading effect From f14a4f7fe9f7d8e1a081d09cab370a15c9af2abb Mon Sep 17 00:00:00 2001 From: Maxim Kochurov Date: Wed, 24 Jul 2024 13:41:20 +0300 Subject: [PATCH 2/3] Update docs in transformers.py docs: fix other docstrings --- pymc_marketing/mmm/transformers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymc_marketing/mmm/transformers.py b/pymc_marketing/mmm/transformers.py index 82b55323e..36f88740c 100644 --- a/pymc_marketing/mmm/transformers.py +++ b/pymc_marketing/mmm/transformers.py @@ -211,7 +211,7 @@ def geometric_adstock( The axis of ``x`` along witch to apply the convolution mode : ConvMode, optional The convolution mode determines how the convolution is applied at the boundaries - of the input signal, denoted as "x." The default mode is ConvMode.Before. + of the input signal, denoted as "x." The default mode is ConvMode.After. - ConvMode.After: Applies the convolution with the "Adstock" effect, resulting in a trailing decay effect. - ConvMode.Before: Applies the convolution with the "Excitement" effect, creating a leading effect @@ -293,7 +293,7 @@ def delayed_adstock( The axis of ``x`` along witch to apply the convolution mode : ConvMode, optional The convolution mode determines how the convolution is applied at the boundaries - of the input signal, denoted as "x." The default mode is ConvMode.Before. + of the input signal, denoted as "x." The default mode is ConvMode.After. - ConvMode.After: Applies the convolution with the "Adstock" effect, resulting in a trailing decay effect. - ConvMode.Before: Applies the convolution with the "Excitement" effect, creating a leading effect @@ -396,7 +396,7 @@ def weibull_adstock( The axis of ``x`` along witch to apply the convolution mode : ConvMode, optional The convolution mode determines how the convolution is applied at the boundaries - of the input signal, denoted as "x." The default mode is ConvMode.Before. + of the input signal, denoted as "x." The default mode is ConvMode.After. - ConvMode.After: Applies the convolution with the "Adstock" effect, resulting in a trailing decay effect. - ConvMode.Before: Applies the convolution with the "Excitement" effect, creating a leading effect From ac87ebee97e7f8948184e63fd173a5db785dd001 Mon Sep 17 00:00:00 2001 From: Will Dean Date: Mon, 29 Jul 2024 21:07:11 +0200 Subject: [PATCH 3/3] change the plot default --- pymc_marketing/mmm/transformers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pymc_marketing/mmm/transformers.py b/pymc_marketing/mmm/transformers.py index fb5b0e350..8f2ab48aa 100644 --- a/pymc_marketing/mmm/transformers.py +++ b/pymc_marketing/mmm/transformers.py @@ -58,7 +58,7 @@ def batched_convolution( ax = plt.subplot(111) for mode in [ConvMode.Before, ConvMode.Overlap, ConvMode.After]: y = batched_convolution(spends, w, mode=mode).eval() - suffix = "\n(default)" if mode == ConvMode.Before else "" + suffix = "\n(default)" if mode == ConvMode.After else "" plt.plot(x, y, label=f'{mode.value}{suffix}') plt.xlabel('time since spend', fontsize=12) plt.ylabel('f(time since spend)', fontsize=12) @@ -70,9 +70,9 @@ def batched_convolution( Parameters ---------- - x : + x : tensor_like The array to convolve. - w : + w : tensor_like The weight of the convolution. The last axis of ``w`` determines the number of steps to use in the convolution. axis : int @@ -89,7 +89,7 @@ def batched_convolution( Returns ------- - y : + y : tensor_like The result of convolving ``x`` with ``w`` along the desired axis. The shape of the result will match the shape of ``x`` up to broadcasting with ``w``. The convolved axis will show the results of left padding zeros to ``x`` while applying the