Skip to content

Commit 670120a

Browse files
authored
Correcting typo around yml files and csv files. (#1888)
1 parent 4631ba1 commit 670120a

13 files changed

+180
-15
lines changed

data/config_files/basic_model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model:
66
- channel_1
77
- channel_2
88
#
9-
target_column: "kpi_registrations"
9+
target_column: "y"
1010

1111
# --- media transformations ---------------------------------------
1212
adstock:

data/config_files/example_with_original_scale_vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model:
66
- channel_1
77
- channel_2
88
#
9-
target_column: "kpi_registrations"
9+
target_column: "y"
1010

1111
# --- media transformations ---------------------------------------
1212
adstock:

data/config_files/multi_dimensional_hierarchical_model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model:
66
- channel_1
77
- channel_2
88
#
9-
target_column: "kpi_registrations"
9+
target_column: "y"
1010
dims: ["market"] # Keep as array for consistency
1111
# Standard scaling format
1212
scaling:

data/config_files/multi_dimensiona_hierarchical_model_nested_config.yml renamed to data/config_files/multi_dimensional_hierarchical_model_nested_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model:
66
- channel_1
77
- channel_2
88
#
9-
target_column: "kpi_registrations"
9+
target_column: "y"
1010
dims: ["market"] # Keep as array for consistency
1111
# Standard scaling format using class/kwargs pattern
1212
scaling:

data/config_files/multi_dimensional_hierarchical_with_arbitrary_effects_model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model:
66
- channel_1
77
- channel_2
88
#
9-
target_column: "kpi_registrations"
9+
target_column: "y"
1010
dims: ["market"] # Keep as array for consistency
1111
# Standard scaling format
1212
scaling:

data/config_files/multi_dimensional_model.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ model:
66
- channel_1
77
- channel_2
88
#
9-
target_column: "kpi_registrations"
9+
target_column: "y"
1010
dims: ["market"]
1111

1212
# --- media transformations ---------------------------------------
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
model:
2+
class: pymc_marketing.mmm.multidimensional.MMM
3+
kwargs:
4+
date_column: "date"
5+
channel_columns:
6+
- channel_1
7+
- channel_2
8+
target_column: "y"
9+
dims: ["market"]
10+
scaling:
11+
target:
12+
method: "max"
13+
dims: []
14+
channel:
15+
method: "max"
16+
dims: []
17+
18+
# --- media transformations ---------------------------------------
19+
adstock:
20+
class: pymc_marketing.mmm.GeometricAdstock
21+
kwargs:
22+
l_max: 24
23+
priors:
24+
alpha:
25+
distribution: "Beta"
26+
alpha: 1.0
27+
beta: 3.0
28+
dims: ["market", "channel"]
29+
30+
saturation:
31+
class: pymc_marketing.mmm.MichaelisMentenSaturation
32+
kwargs:
33+
priors:
34+
lam:
35+
distribution: "Gamma"
36+
mu: 5.0
37+
sigma: 2.0
38+
dims: ["market"]
39+
alpha:
40+
distribution: "Beta"
41+
alpha: 1.0
42+
beta: 2.0
43+
dims: ["market", "channel"]
44+
45+
# --- model (hierarchical) priors ---------------------------------
46+
model_config:
47+
intercept:
48+
distribution: Gamma
49+
mu: 0.5
50+
sigma: 1.0
51+
dims: ["market"]
52+
53+
likelihood:
54+
distribution: TruncatedNormal
55+
lower: 0
56+
sigma:
57+
distribution: "Gamma"
58+
mu: 1.0
59+
sigma: 0.5
60+
dims: ["market"]
61+
dims: ["date", "market"]
62+
# ----------------------------------------------------------------------
63+
# (optional) sampler options you plan to forward to pm.sample():
64+
sampler_config:
65+
tune: 900
66+
draws: 500
67+
chains: 4
68+
random_seed: 42
69+
target_accept: 0.92
70+
# nuts_sampler: "nutpie"
71+
# nuts_sampler_kwargs:
72+
# backend: "jax"
73+
74+
# ----------------------------------------------------------------------
75+
# Effects with complex priors
76+
effects:
77+
# 1. Linear Trend Effect with complex nested priors
78+
- class: pymc_marketing.mmm.additive_effect.LinearTrendEffect
79+
kwargs:
80+
trend:
81+
class: pymc_marketing.mmm.LinearTrend
82+
kwargs:
83+
n_changepoints: 8
84+
include_intercept: false
85+
priors:
86+
delta:
87+
distribution: "Laplace"
88+
mu: 0
89+
b: 0.2
90+
dims: ["market", "changepoint"]
91+
dims: ["market"]
92+
prefix: "trend"
93+
94+
# 2. Fourier Effect with complex nested priors
95+
- class: pymc_marketing.mmm.additive_effect.FourierEffect
96+
kwargs:
97+
fourier:
98+
class: pymc_marketing.mmm.WeeklyFourier
99+
kwargs:
100+
n_order: 3
101+
prefix: "weekly_fourier"
102+
prior:
103+
distribution: "Laplace"
104+
mu: 0
105+
b: 0.1
106+
dims: ["weekly_fourier", "market"]
107+
108+
# 3. Events upper funnel
109+
- class: pymc_marketing.mmm.additive_effect.EventAdditiveEffect
110+
kwargs:
111+
effect:
112+
class: pymc_marketing.mmm.events.EventEffect
113+
kwargs:
114+
basis:
115+
class: pymc_marketing.mmm.events.GaussianBasis
116+
kwargs:
117+
priors:
118+
sigma:
119+
distribution: "Gamma"
120+
mu: 5.0
121+
sigma: 2.0
122+
dims: ["event"]
123+
effect_size:
124+
class: pymc_extras.prior.Prior
125+
kwargs:
126+
distribution: "Beta"
127+
alpha: 1
128+
beta: 2
129+
dims: ["event"]
130+
dims: ["event"]
131+
df_events:
132+
class: pandas.DataFrame
133+
kwargs:
134+
data: {
135+
"name": ["flight 1", "flight 2", "flight 3", "flight 4"],
136+
"market": ["US", "US", "US", "US"],
137+
"start_date": [
138+
"2023-01-10",
139+
"2023-01-20",
140+
"2023-02-01",
141+
"2023-02-20",
142+
],
143+
"end_date": [
144+
"2023-01-15",
145+
"2023-01-25",
146+
"2023-02-05",
147+
"2023-03-15",
148+
],
149+
}
150+
prefix: "event"
151+
152+
original_scale_vars:
153+
- y
154+
- channel_contribution
155+
- intercept_contribution
156+
- trend_effect_contribution
157+
# ----------------------------------------------------------------------
158+
# (optional) idata from a previous sample
159+
# idata_path: "data/idata.nc"
160+
161+
# ----------------------------------------------------------------------
162+
# (optional) Data paths
163+
# data:
164+
# X_path: "data/X.csv"
165+
# y_path: "data/y.csv"

data/processed/y.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
kpi_registrations
1+
y
22
45.45380610164261
33
42.51634583133759
44
54.25093939558018

docs/source/notebooks/mmm/mmm_build_from_yml_example.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
" <thead>\n",
159159
" <tr style=\"text-align: right;\">\n",
160160
" <th></th>\n",
161-
" <th>kpi_registrations</th>\n",
161+
" <th>y</th>\n",
162162
" </tr>\n",
163163
" </thead>\n",
164164
" <tbody>\n",
@@ -179,7 +179,7 @@
179179
"</div>"
180180
],
181181
"text/plain": [
182-
" kpi_registrations\n",
182+
" y\n",
183183
"0 45.453806\n",
184184
"1 42.516346\n",
185185
"2 54.250939"
@@ -1767,7 +1767,7 @@
17671767
"source": [
17681768
"mmm.fit(\n",
17691769
" X=X,\n",
1770-
" y=y.kpi_registrations,\n",
1770+
" y=y.y,\n",
17711771
" random_seed=42,\n",
17721772
")\n",
17731773
"\n",
@@ -1803,7 +1803,7 @@
18031803
" - channel_1\n",
18041804
" - channel_2\n",
18051805
" # …\n",
1806-
" target_column: \"kpi_registrations\"\n",
1806+
" target_column: \"y\"\n",
18071807
"\n",
18081808
" # --- media transformations ---------------------------------------\n",
18091809
" adstock:\n",

tests/mmm/builders/config_files/wrong_adstock_class.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ model:
55
channel_columns:
66
- channel_1
77
- channel_2
8-
target_column: "kpi_registrations"
8+
target_column: "y"
99

1010
# Wrong adstock configuration - invalid class name
1111
adstock:

0 commit comments

Comments
 (0)