Skip to content

Commit 83ff985

Browse files
committed
add tests
1 parent 7663c08 commit 83ff985

File tree

2 files changed

+408
-5
lines changed

2 files changed

+408
-5
lines changed

pymc_marketing/mmm/mmm.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@
6666

6767
# Constants
6868
DEFAULT_HDI_PROB = 0.94
69-
DEFAULT_LOWER_QUANTILE = 0.025
70-
DEFAULT_UPPER_QUANTILE = 0.975
71-
DEFAULT_QUANTILE = 0.5
72-
DEFAULT_N_PERCENTILES = 30
7369

7470

7571
class BaseMMM(BaseValidateMMM):
@@ -449,9 +445,11 @@ def _compute_scales(self) -> None:
449445
self.channel_scale = self._compute_scale_for_data(
450446
channel_data, self.scaling.channel.method, axis=0
451447
)
452-
self.target_scale = self._compute_scale_for_data(
448+
target_scale = self._compute_scale_for_data(
453449
target_data, self.scaling.target.method, axis=None
454450
)
451+
# Ensure target_scale is a Python float (convert from numpy scalar if needed)
452+
self.target_scale = float(target_scale)
455453

456454
def create_idata_attrs(self) -> dict[str, str]:
457455
"""Create attributes for the inference data.

0 commit comments

Comments
 (0)