-
Notifications
You must be signed in to change notification settings - Fork 285
Out-of-Box MultiDimensional MMM #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1036 +/- ##
==========================================
- Coverage 94.73% 92.48% -2.25%
==========================================
Files 51 52 +1
Lines 5505 5947 +442
==========================================
+ Hits 5215 5500 +285
- Misses 290 447 +157 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@cetagostini I've been experimenting with this new feature and came across a potential bug. When trying to use partial pulling across a geo dim, I am running into a broadcasting error. Looking like its throwing that error when creating the
However, modifying that to include the dims being passed to the
fixes the broadcasting error and I was able to fit the model from there. Here's the full traceback - @wd60622
|
Good catch @tim-mcwilliams @cetagostini You can do checks on the dims in the priors at initialization in order to catch errors earlier if needed |
@wd60622 thanks! Correct, with the fix I was able to get the model working. |
hi guys, this looks really good and useful! Thanks for pointing me here, @cetagostini I've read the example notebook and I have some questions:
|
Hey @luiztauffer Not exactly. Running 4 separate MMMs treats each dimension (e.g., country or channel) as independent, with no shared parameters or assumptions. VanillaMultiDimensionalMMM (Currently only MMM class) uses a unified probabilistic framework where all dimensions (e.g., country, channel) are modeled together within a single Bayesian model. While it may seem like separate models are being trained because results are reported or analyzed per dimension, these dimensions are interdependent. For example:
So, while the output may look dimension-specific (e.g., country-level or channel-level effects), the model leverages cross-dimensional information during training 🙌🏻 |
@wd60622 feel free to jump if you want. Play around today and get a head start on the API, for now we are able to properly train a mmm with all the features of the current MMM class. Basically we have TVPs and hierarchical structures, with the possibility of being multi-dimensional. On the other hand, scaling occurs within the model, avoiding the need to scale inputs in plots or outputs in the model, everything is ready to use, reducing functions like
|
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:25Z Before me we merge we need to add a basic title and a short intro. I can refine and complete in a following pr |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:26Z add text on the class type |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:27Z Comment on the Prior structure |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:28Z Explain how to specfy the model |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:29Z Provide a summary on the model structure. In particular, which variables are hierarchical and so on ... Again, I can add more info on a subsequent pr |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:30Z Explain this (do we need it?) |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:31Z explain this plot |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:32Z Explain all of these plots |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:35:32Z explain the context of this model (and comments line at the end?) |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2025-02-04T12:36:30Z add watermark at the end |
@cetagostini @wd60622 this looks great! I left some minor comments on the code. Overal,l it looks almost good to go. We need to add some basic text explanation to the notebook because we just have code. I can take over the notebook improvements in a following PR, but for this one we need the bare minimum ;) This is going to be a game changer! Amazing job! |
All feedback should be included now @juanitorduz |
Thank will! I usually do not work with pandas + indices wo maybe you know more when df.reset_index() could be a problem. Otherwise is all good ! Thanks! |
ahg, iths seems the precommit job is broken :( |
The API should work like before which didn't make use of an actual index / MultiIndex |
They passed locally. Trust me |
Description
Creating an API to support multiple dims.
Related Issue
Checklist
Modules affected
Type of change
📚 Documentation preview 📚: https://pymc-marketing--1036.org.readthedocs.build/en/1036/