Skip to content

Conversation

@cetagostini
Copy link
Contributor

@cetagostini cetagostini commented Aug 10, 2025

Description

Allow passing an HSGPBase instance (e.g., SoftPlusHSGP) to the time_varying_media argument in MMM, enabling custom latent process dimensions and priors. Update logic to handle both boolean and HSGPBase types, and add tests to verify correct behavior and dimension broadcasting for both single- and multi-dimensional cases.

Related Issue

Checklist


📚 Documentation preview 📚: https://pymc-marketing--1881.org.readthedocs.build/en/1881/

Allow passing an HSGPBase instance (e.g., SoftPlusHSGP) to the time_varying_media argument in MMM, enabling custom latent process dimensions and priors. Update logic to handle both boolean and HSGPBase types, and add tests to verify correct behavior and dimension broadcasting for both single- and multi-dimensional cases.
Copy link
Contributor

@williambdean williambdean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think this looks good. We can follow up with the time_varying_intercept. Just a question about the backward compat side here.

dims=("date", *self.dims),
**self.model_config["media_tvp_config"],
).create_variable("media_latent_process")
).create_variable("media_temporal_latent_multiplier")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will these name changes cause any issues?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we update the model_version number ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should not bring issues, users can always ping or retrain. But I'll update model version.

@cetagostini cetagostini marked this pull request as ready for review August 11, 2025 18:24
@cetagostini cetagostini self-assigned this Aug 11, 2025
@github-actions github-actions bot added TVPs Related to time varying parameters enhancement New feature or request labels Aug 11, 2025
@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (20c2ca0) to head (43bbe64).
⚠️ Report is 126 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1881      +/-   ##
==========================================
+ Coverage   91.84%   91.86%   +0.01%     
==========================================
  Files          64       64              
  Lines        7533     7546      +13     
==========================================
+ Hits         6919     6932      +13     
  Misses        614      614              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cetagostini cetagostini merged commit bca55e4 into main Aug 11, 2025
33 checks passed
@cetagostini cetagostini deleted the cetagostini/new_hsgp_parametrization branch August 11, 2025 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request MMM tests TVPs Related to time varying parameters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow for HSGP Component in MMM class

3 participants