Implement MultiDimensionalMMM with pymc.dims#2204
Implement MultiDimensionalMMM with pymc.dims#2204ricardoV94 wants to merge 9 commits intopymc-labs:mainfrom
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
| name="channel_contribution", | ||
| var=baseline_channel_contribution * media_broadcast, | ||
| dims=("date", *self.dims, "channel"), | ||
| channel_contribution = pmd.Deterministic( |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2204 +/- ##
==========================================
- Coverage 93.20% 88.52% -4.69%
==========================================
Files 79 80 +1
Lines 12477 12485 +8
==========================================
- Hits 11629 11052 -577
- Misses 848 1433 +585 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
cetagostini
left a comment
There was a problem hiding this comment.
Hey! I found a few typos while reviewing the pymc.dims implementation. See inline comments below 👇
cetagostini
left a comment
There was a problem hiding this comment.
A few more inconsistencies I noticed - some return type annotations say TensorVariable but the code actually returns XTensorVariable 🤔
Function Equivalence Testing Results 🧪I tested the transformation functions to verify they produce equivalent outputs with the new ✅ All Functions Pass Numerical Equivalence
|
|
Yes order doesn't matter while in xtensor land. You can always transpose explicitly to another order, which you should do if you need to go to tensor land (via .values). Note even if not so relevant, dimension order matches the same as xarray |
2a75405 to
c2193c6
Compare
aa79d7b to
c9a5a89
Compare
| budgets_expanded * self._budget_distribution_over_period_tensor | ||
| ) # Shape: (num_periods, num_optimized_budgets) | ||
| budgets_optimized * self._budget_distribution_over_period_tensor | ||
| ).transpose("date", "budgets_flat") |
d8bfaaa to
872eeec
Compare
9c0e68c to
26d9b9b
Compare
|
Legacy MMM/Optimizer now work with pymc.dims and the refactored components. This PR now depends on pymc-devs/pymc-extras#657 to help with the transition into dim world, so the CI will be ready until we re-sync |
f699e67 to
b825820
Compare
e72dfa2 to
5c0b641
Compare
|
Failing test depends on pymc-devs/pymc#8124 |
TODO:
Closes #1981
Closes #1514
Closes #1630 (just a regression test, it worked fine before)
📚 Documentation preview 📚: https://pymc-marketing--2204.org.readthedocs.build/en/2204/