pymc-labs / pymc-marketing

Bayesian marketing toolbox in PyMC. Media Mix (MMM), customer lifetime value (CLV), buy-till-you-die (BTYD) models and more.
https://www.pymc-marketing.io/
Apache License 2.0
648 stars 175 forks source link

Save lift tests to InferenceData #833

Open wd60622 opened 1 month ago

wd60622 commented 1 month ago

This would be required to rebuild same model after using lift test methods.

Currently missing:

An alternative to this would be to save the lift test to a separate group. However, this would likely cause some additional complexity and would have to capture additional warnings. The fit_data just runs the risk of having to change the structure of the fit_data group itself and likely have to have a version bump of the model.

wd60622 commented 1 month ago

The kwargs used with the would have to be saved off as well or the reconstructed model would not be the same https://github.com/pymc-labs/pymc-marketing/blob/4bddf9450f7a85ade4a03ccb47af55bcefc4b982/pymc_marketing/mmm/delayed_saturated_mmm.py#L1735-L1740

Potentially these kwargs in the attrs like in the save and load methods. This seems to require that each df_lift_test would have to be saved in separate variable? Maybe using another group like lift_tests would be more clear?