Skip to content

CLV API Deprecation#2347

Open
ColtAllen wants to merge 53 commits intopymc-labs:mainfrom
ColtAllen:clv-api-change
Open

CLV API Deprecation#2347
ColtAllen wants to merge 53 commits intopymc-labs:mainfrom
ColtAllen:clv-api-change

Conversation

@ColtAllen
Copy link
Collaborator

@ColtAllen ColtAllen commented Feb 28, 2026

Description

This PR brings the CLV API more in line with that of MMM by making the following change:

# old API
CLVModel(data).fit()

# new API
CLVModel().fit(data)

The old API will still be supported until v1.0. All notebooks have been updated with the new API.

This change is needed for improved model persistence (see related issue) which will be addressed in follow-up PRs.

Discussion Needed

Currently, covariates are parametrized as model config kwargs. For user convenience, is it also worth adding separate parameters for covariates? Would look like this:

covariates = {
    "purchase_cols": ["channel", "region"],
    "dropout_cols": ["tier"],
}

model = BetaGeoModel.with_covariates(
    purchase_cols=["channel", "region"],
    dropout_cols=["tier"],
    model_config=covariates, # old method (still supported)
)

Related Issue

Checklist


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

@ColtAllen ColtAllen added this to the 1.0 milestone Feb 28, 2026
@ColtAllen ColtAllen self-assigned this Feb 28, 2026
@ColtAllen ColtAllen added docs Improvements or additions to documentation CLV request discussion tests major API breaking changes API labels Feb 28, 2026
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@cursor
Copy link
Contributor

cursor bot commented Feb 28, 2026

PR Summary

Low Risk
Low risk because changes are limited to editor/tooling guidance in .cursor/rules/basic.mdc and do not affect runtime code or behavior.

Overview
Adds a description field and expands .cursor/rules/basic.mdc with guidance to run pytest/pre-commit/python using the active environment’s absolute bin/ executable path (discovered via which/where) instead of relying on PATH.

Written by Cursor Bugbot for commit 849e146. This will update automatically on new commits. Configure here.

@github-actions github-actions bot added MMM ModelBuilder Related to the ModelBuilder class and its children labels Feb 28, 2026
@codecov
Copy link

codecov bot commented Feb 28, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.13%. Comparing base (877de08) to head (849e146).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
pymc_marketing/clv/models/shifted_beta_geo.py 89.18% 4 Missing ⚠️
pymc_marketing/clv/models/gamma_gamma.py 88.88% 2 Missing ⚠️
pymc_marketing/clv/models/beta_geo_beta_binom.py 90.90% 1 Missing ⚠️
pymc_marketing/clv/models/modified_beta_geo.py 85.71% 1 Missing ⚠️
pymc_marketing/clv/models/pareto_nbd.py 95.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2347      +/-   ##
==========================================
- Coverage   93.15%   93.13%   -0.03%     
==========================================
  Files          79       79              
  Lines       12523    12610      +87     
==========================================
+ Hits        11666    11744      +78     
- Misses        857      866       +9     

☔ 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

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

@juanitorduz
Copy link
Collaborator

I think this PR is removing some .nc files

@ColtAllen
Copy link
Collaborator Author

I think this PR is removing some .nc files

Do the MMM notebooks require them? These files are quite large.

@juanitorduz
Copy link
Collaborator

Yes, for now we do. We might remove it later (but should be a different PR :) )

@ColtAllen
Copy link
Collaborator Author

ColtAllen commented Mar 2, 2026

We might remove it later (but should be a different PR :) )

Agreed; files restored.

@juanitorduz
Copy link
Collaborator

Thanks @ColtAllen I will check this one in the upcoming days 💪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API CLV docs Improvements or additions to documentation major API breaking changes mlflow MMM ModelBuilder Related to the ModelBuilder class and its children request discussion tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants