pymc-marketing
pymc-marketing copied to clipboard
idata is removed if fit is called
Example:
import pandas as pd
from pymc_marketing.mmm import DelayedSaturatedMMM
df = pd.read_csv("datasets/mmm_example.csv", parse_dates=["date_week"])
mmm = DelayedSaturatedMMM(
date_column="date_week",
channel_columns=["x1", "x2"],
adstock_max_lag=12,
)
y = df.pop("y")
mmm.sample_prior_predictive(df, extend_idata=True)
# mmm.idata is completely replaced in the fit method
mmm.fit(df, y)
That replacement seems to happen here: https://github.com/pymc-labs/pymc-marketing/blob/main/pymc_marketing/model_builder.py#L477
I started fixing this in https://github.com/pymc-labs/pymc-marketing/pull/414 but didn't take it to the finish line yet
Sounds good. Sorry to reraise
@ricardoV94 Does the join kwarg address this?
I think we are still overriding any old idata when we call fit
, even in #482