Skip to content
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

Pass arbitrary HSGP to MMM class #1432

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wd60622
Copy link
Contributor

@wd60622 wd60622 commented Jan 24, 2025

Description

WIP but the API would look like this:

hsgp = SoftPlusHSGP.parameterize_from_data(
    np.arange(X.shape[0]),
    dims=("date", "channel"),
)

mmm = MMM(
    adstock=GeometricAdstock(l_max=8),
    saturation=LogisticSaturation(),
    date_column="date_week",
    channel_columns=["x1", "x2"],
    control_columns=[
        "event_1",
        "event_2",
        "t",
    ],
    time_varying_media=hsgp,
    yearly_seasonality=2,
)
mmm.fit(X, y)

CC: @cetagostini

Related Issue

  • Closes #
  • Related to #

Checklist


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

@wd60622 wd60622 linked an issue Jan 24, 2025 that may be closed by this pull request
@github-actions github-actions bot added MMM TVPs Related to time varying parameters enhancement New feature or request labels Jan 24, 2025
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 75.86207% with 14 lines in your changes missing coverage. Please review.

Project coverage is 94.40%. Comparing base (d9f0c51) to head (264ed2e).

Files with missing lines Patch % Lines
pymc_marketing/mmm/mmm.py 62.06% 11 Missing ⚠️
pymc_marketing/mmm/hsgp.py 81.25% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1432      +/-   ##
==========================================
- Coverage   94.62%   94.40%   -0.23%     
==========================================
  Files          50       50              
  Lines        5416     5448      +32     
==========================================
+ Hits         5125     5143      +18     
- Misses        291      305      +14     

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

@juanitorduz
Copy link
Collaborator

cool!

@cetagostini
Copy link
Contributor

Like it will implement on #1036

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