diff --git a/pymc_marketing/mmm/transformers.py b/pymc_marketing/mmm/transformers.py index a37e8abff..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,16 +70,16 @@ 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 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 @@ -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 @@ -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