Skip to content

Commit

Permalink
Fix default ConvMode in docstring (pymc-labs#864)
Browse files Browse the repository at this point in the history
* Update docs in transformers.py

docs: Fix the docstring

* Update docs in transformers.py

docs: fix other docstrings

* change the plot default

---------

Co-authored-by: Will Dean <57733339+wd60622@users.noreply.github.com>
Co-authored-by: Will Dean <wd60622@gmail.com>
  • Loading branch information
3 people authored and radiokosmos committed Sep 1, 2024
1 parent 9a328ae commit 634c068
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pymc_marketing/mmm/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 634c068

Please sign in to comment.