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

GammaGammaModel Docstrings and API Standardization #758

Merged
merged 21 commits into from
Jun 27, 2024

Conversation

ColtAllen
Copy link
Collaborator

@ColtAllen ColtAllen commented Jun 19, 2024

Description

This is the final PR to standardize the CLV API prior to the new release. It also speeds up the customer_lifetime_value function quite a bit because it gets rid of a FOR loop initialization that raises a DIV/0 warning.

Right now it's still a draft so that I can review the docs prebuild to make any necessary edits to the docstrings. The Quickstart and Gamma-Gamma notebooks will also require revision.

It's worth noting there's an additional Gamma-Gamma model for individual customers that isn't referenced in any of the notebooks.

Related Issue

Checklist

Modules affected

  • MMM
  • CLV

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

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

@ColtAllen ColtAllen added docs Improvements or additions to documentation invalid This doesn't seem right CLV maintenance tests priority: high major API breaking changes labels Jun 19, 2024
@ColtAllen ColtAllen added this to the 0.7.0 milestone Jun 19, 2024
@ColtAllen ColtAllen self-assigned this Jun 19, 2024
@ColtAllen ColtAllen mentioned this pull request Jun 19, 2024
6 tasks
@ColtAllen ColtAllen changed the title GammaGammaModel API GammaGammaModel API Improvements Jun 19, 2024
Copy link

codecov bot commented Jun 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.89%. Comparing base (0bfca1a) to head (e116420).

Current head e116420 differs from pull request most recent head 05cfd5e

Please upload reports for the commit 05cfd5e to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #758      +/-   ##
==========================================
+ Coverage   93.87%   93.89%   +0.01%     
==========================================
  Files          28       28              
  Lines        2972     2948      -24     
==========================================
- Hits         2790     2768      -22     
+ Misses        182      180       -2     

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

Copy link
Collaborator

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

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

Lookin good!! Just left some small comments. Just ping me again when you are ready for a final review.

pymc_marketing/clv/models/gamma_gamma.py Outdated Show resolved Hide resolved
pymc_marketing/clv/models/gamma_gamma.py Show resolved Hide resolved
pymc_marketing/clv/models/gamma_gamma.py Outdated Show resolved Hide resolved
pymc_marketing/clv/models/gamma_gamma.py Show resolved Hide resolved
tests/clv/test_utils.py Show resolved Hide resolved
pymc_marketing/clv/models/gamma_gamma.py Outdated Show resolved Hide resolved
pymc_marketing/clv/models/gamma_gamma.py Outdated Show resolved Hide resolved
pymc_marketing/clv/utils.py Outdated Show resolved Hide resolved
pymc_marketing/clv/utils.py Outdated Show resolved Hide resolved
@juanitorduz
Copy link
Collaborator

He y @ColtAllen is this one ready fro a final review or merge?

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@ColtAllen ColtAllen marked this pull request as ready for review June 25, 2024 23:31
@ColtAllen
Copy link
Collaborator Author

He y @ColtAllen is this one ready fro a final review or merge?

It's ready for review now, but there's a merge conflict in the Quickstart notebook and I'm unable to resolve it.

This reverts commit a3154d9.
@juanitorduz
Copy link
Collaborator

It's ready for review now, but there's a merge conflict in the Quickstart notebook and I'm unable to resolve it.

Ups! Notebooks are a pain! I suggest removing it from the PR, rebase and commit it again (or open another PR with the notebook later)

https://stackoverflow.com/questions/38743912/remove-a-file-from-a-git-pull-request

@juanitorduz
Copy link
Collaborator

Can you please push an empty commit to trigger the CI again? (I seems its stuck)

@ColtAllen
Copy link
Collaborator Author

I've reverted the CLV Quickstart changes. I'll do one more quick PR for this (and any other discrepancies in the docs) before the next release.

Copy link
Collaborator

@juanitorduz juanitorduz left a comment

Choose a reason for hiding this comment

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

LGTM!

Before you merge, could you please fix the two small doc issues below? Thanks :D

pymc_marketing/clv/models/gamma_gamma.py Outdated Show resolved Hide resolved
pymc_marketing/clv/models/gamma_gamma.py Show resolved Hide resolved
@juanitorduz
Copy link
Collaborator

@ColtAllen is this one ready to be merged 🟢 ?

@juanitorduz
Copy link
Collaborator

Aslo, do you think this is enough for 0.7.0 (in view of #527 ?)

@ColtAllen ColtAllen merged commit cec2cc2 into pymc-labs:main Jun 27, 2024
10 checks passed
@ColtAllen ColtAllen deleted the gamma_gamma_api branch June 27, 2024 08:02
@ColtAllen
Copy link
Collaborator Author

Aslo, do you think this is enough for 0.7.0 (in view of #527 ?)

Yes; the remaining tasks in that issue are BetaGeoModel specific and extraneous to API standardization, so I'll close that issue and create a new one for the BG/NBD tasks.

I'll get started on the PR today for the CLV Quickstart and docstring proof-reading.

@ColtAllen ColtAllen changed the title GammaGammaModel API Improvements GammaGammaModel Docstrings and API Standardization Jun 27, 2024
twiecki pushed a commit that referenced this pull request Sep 10, 2024
* utils.customer_lifetime_value

* expected_customer_lifetime_value

* WIP clv.models.gamma_gamma.py

* gamma_gamma API

* fixed circular import

* gamma_gamma tests

* delete tests/datasets/test_summary.csv

* clv test_utils.py

* remove expected_purchases(future_t=0)

* remove monetary_value arg

* WIP docstrings

* notebooks

* docstrings

* Revert "notebooks"

This reverts commit a3154d9.

* gamma-gamma notebook

* docstrings
twiecki pushed a commit that referenced this pull request Sep 10, 2024
* utils.customer_lifetime_value

* expected_customer_lifetime_value

* WIP clv.models.gamma_gamma.py

* gamma_gamma API

* fixed circular import

* gamma_gamma tests

* delete tests/datasets/test_summary.csv

* clv test_utils.py

* remove expected_purchases(future_t=0)

* remove monetary_value arg

* WIP docstrings

* notebooks

* docstrings

* Revert "notebooks"

This reverts commit a3154d9.

* gamma-gamma notebook

* docstrings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLV docs Improvements or additions to documentation invalid This doesn't seem right maintenance major API breaking changes priority: high tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants