Skip to content

Commit 75eead7

Browse files
ango94williambdeanjuanitorduz
authored
Change baseline_intercept to intercept_baseline for consistent prefix (#1529)
* changed baseline_intercept to intercept_baseline for consistency * updated notebook to reference intecept_baseline * fixed typo in notebook code example --------- Co-authored-by: Will Dean <57733339+wd60622@users.noreply.github.com> Co-authored-by: Juan Orduz <juanitorduz@gmail.com> Co-authored-by: Will Dean <57733339+williambdean@users.noreply.github.com>
1 parent 7e6dc09 commit 75eead7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

docs/source/notebooks/mmm/mmm_tvp_example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -691,7 +691,7 @@
691691
},
692692
{
693693
"cell_type": "code",
694-
"execution_count": 9,
694+
"execution_count": null,
695695
"metadata": {},
696696
"outputs": [
697697
{
@@ -707,7 +707,7 @@
707707
" print(\n",
708708
" \"base_intercept:\",\n",
709709
" float(\n",
710-
" mmm.idata.posterior.baseline_intercept.mean()\n",
710+
" mmm.idata.posterior.intercept_baseline.mean()\n",
711711
" * mmm.target_transformer.steps[0][1].scale_[0]\n",
712712
" ),\n",
713713
" )\n",

pymc_marketing/mmm/mmm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def __init__(
146146
time_varying_intercept : bool, optional
147147
Whether to consider time-varying intercept, by default False.
148148
Because the `time-varying` variable is centered around 1 and acts as a multiplier,
149-
the variable `baseline_intercept` now represents the mean of the time-varying intercept.
149+
the variable `intercept_baseline` now represents the mean of the time-varying intercept.
150150
time_varying_media : bool, optional
151151
Whether to consider time-varying media contributions, by default False.
152152
The `time-varying-media` creates a time media variable centered around 1,
@@ -501,8 +501,8 @@ def build_model(
501501
)
502502

503503
if self.time_varying_intercept:
504-
baseline_intercept = self.model_config["intercept"].create_variable(
505-
"baseline_intercept"
504+
intercept_baseline = self.model_config["intercept"].create_variable(
505+
"intercept_baseline"
506506
)
507507

508508
intercept_latent_process = create_time_varying_gp_multiplier(
@@ -515,7 +515,7 @@ def build_model(
515515
)
516516
intercept = pm.Deterministic(
517517
name="intercept",
518-
var=baseline_intercept * intercept_latent_process,
518+
var=intercept_baseline * intercept_latent_process,
519519
dims="date",
520520
)
521521
else:

pymc_marketing/mmm/multidimensional.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,8 @@ def build_model(
966966

967967
# Add intercept logic
968968
if self.time_varying_intercept:
969-
baseline_intercept = self.model_config["intercept"].create_variable(
970-
"baseline_intercept"
969+
intercept_baseline = self.model_config["intercept"].create_variable(
970+
"intercept_baseline"
971971
)
972972

973973
intercept_latent_process = SoftPlusHSGP.parameterize_from_data(
@@ -978,7 +978,7 @@ def build_model(
978978

979979
intercept = pm.Deterministic(
980980
name="intercept_contribution",
981-
var=baseline_intercept[None, ...] * intercept_latent_process,
981+
var=intercept_baseline[None, ...] * intercept_latent_process,
982982
dims=("date", *self.dims),
983983
)
984984
else:

0 commit comments

Comments
 (0)