Skip to content

Conversation

@cetagostini
Copy link
Contributor

@cetagostini cetagostini commented Nov 2, 2025

Description

Kick-off API deprecation. Made a new notebook, in dev not visible to replicate current MMM example but with multidimensional. Only a few plots are missing.

Did additions in the plot API, and adjust some docs.

Related Issue

  • Closes #
  • Related to #

Checklist


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

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions github-actions bot added docs Improvements or additions to documentation MMM tests ModelBuilder Related to the ModelBuilder class and its children customer choice Related to customer choice module labels Nov 2, 2025
@cetagostini cetagostini self-assigned this Nov 2, 2025
@cetagostini cetagostini marked this pull request as ready for review November 2, 2025 22:21
@codecov
Copy link

codecov bot commented Nov 2, 2025

Codecov Report

❌ Patch coverage is 87.58389% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.33%. Comparing base (8fee905) to head (18b60f0).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
pymc_marketing/mmm/plot.py 85.53% 35 Missing ⚠️
pymc_marketing/mmm/utils.py 96.29% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2055      +/-   ##
==========================================
- Coverage   92.49%   92.33%   -0.16%     
==========================================
  Files          68       68              
  Lines        9364     9660     +296     
==========================================
+ Hits         8661     8920     +259     
- Misses        703      740      +37     

☔ 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.

@williambdean
Copy link
Contributor

why so many changes in a single PR 😢

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.

First pass

@cetagostini-wise
Copy link
Contributor

cetagostini-wise commented Nov 3, 2025

why so many changes in a single PR 😢

They are not many, purely docstring change you can ignore (I just move them to correct formatting).

The files with changes are:

  • multidimensional.py
  • plot.py
  • utils.py

All under mmm folder :)

@juanitorduz juanitorduz requested a review from Copilot November 4, 2025 06:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request adds new plotting functionality and utility functions to the MMM module, updates docstring formatting across multiple files, and includes comprehensive test coverage for the new features.

  • Adds build_contributions utility function for processing posterior contribution data into wide DataFrames
  • Adds four new plotting methods: residuals_over_time, residuals_posterior_distribution, posterior_distribution, waterfall_components_decomposition, and channel_contribution_share_hdi
  • Converts docstring examples from REPL-style (>>>) to code-block format for better rendering

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pymc_marketing/mmm/utils.py Adds build_contributions function to aggregate and format contribution variables from posterior data
pymc_marketing/mmm/plot.py Adds new plotting methods for residuals, posterior distributions, waterfall decomposition, and channel contribution shares
tests/mmm/test_utils.py Adds comprehensive test suite for build_contributions function
tests/mmm/test_plot.py Adds extensive test coverage for new plotting methods
pymc_marketing/mmm/multidimensional.py Updates docstring formatting and fixes extend_idata logic in sample_posterior_predictive
pymc_marketing/model_builder.py Converts docstring examples to code-block format
pymc_marketing/mmm/mmm.py Converts docstring examples to code-block format
pymc_marketing/mmm/base.py Converts docstring examples to code-block format
pymc_marketing/customer_choice/nested_logit.py Converts docstring examples to code-block format
pymc_marketing/customer_choice/mnl_logit.py Converts docstring examples to code-block format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

cetagostini and others added 5 commits November 4, 2025 09:53
Changed the prior_predictive method in MMMPlotSuite to accept a single variable name (str) instead of a list of variable names. Updated related logic and documentation to reflect this change for consistency and simplicity. Also added posterior_predictive_constant_data to idata groups in multidimensional.py.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

customer choice Related to customer choice module docs Improvements or additions to documentation MMM ModelBuilder Related to the ModelBuilder class and its children tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants