Skip to content

Conversation

PabloRoque
Copy link
Contributor

@PabloRoque PabloRoque commented Oct 1, 2025

Description

Add Frequency/Reach support via the MuEffect interface.
Similar, but slightly different (see below) to the implementation described here

Notes:

1) The formulation is not strictly equivalent. Notice that our frequency_sat: Tensorvariable already applies the multiplicative Beta coefficient. If we want a fully equivalent implementation we need to call , but then we cannot rely on .apply to do dim_handling.

  1. Introduced HillShapeSaturation to make the formulation equivalent

  2. This is a very drafty feature. No support for optimization whatsoever.

Related Issue

  • Closes #
  • Related to #

Checklist


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

@PabloRoque PabloRoque requested a review from cetagostini October 1, 2025 10:10
@github-actions github-actions bot added the MMM label Oct 1, 2025
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

❌ Patch coverage is 21.73913% with 108 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.12%. Comparing base (539f32c) to head (c32abed).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ting/mmm/additive_effect/frequency_reach_effect.py 17.69% 107 Missing ⚠️
pymc_marketing/mmm/components/saturation.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1968      +/-   ##
==========================================
- Coverage   92.18%   91.12%   -1.07%     
==========================================
  Files          67       69       +2     
  Lines        8147     8424     +277     
==========================================
+ Hits         7510     7676     +166     
- Misses        637      748     +111     

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we change additive_effect.py into additive_effects/ submodule and has this as a file?

Copy link
Contributor

Choose a reason for hiding this comment

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

All can added to __init__ so that the import is kept

Copy link
Contributor

Choose a reason for hiding this comment

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

I like this idea!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am happy to move things around, but for me the main question of this PR is:

  • Should we somehow modify SaturationTransformation to offer strong separation between saturation asymptote and lambda, c, slope, etc?

@juanitorduz
Copy link
Collaborator

Amazing!

@juanitorduz juanitorduz added this to the 0.17.0 milestone Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants