-
Notifications
You must be signed in to change notification settings - Fork 252
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
Beta geo expected probability no purchase #1094
Beta geo expected probability no purchase #1094
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
View / edit / reply to this conversation on ReviewNB juanitorduz commented on 2024-10-19T09:20:24Z Can you please remove this from the notebook? DylanZammit commented on 2024-10-19T09:25:43Z Removed |
Absolutely! Some ideas for this new method are:
|
Removed View entire conversation on ReviewNB |
Thank you! I will try to work on this between today and tomorrow. I have removed the redundant cell-block in the notebook and made reference to Equation 34 which I based the method off in the docstring of the new method. Appreciate the help and feedback, please let me know if there are any other suggested changes and I will review accordingly. |
Following unit tests added:
All tests passed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for creating this PR @DylanZammit. I noticed the expression in the research note includes the model likelihood function, but it seems here you've simplified things and removed terms that would otherwise cancel out. If results are valid this will be a more performant solution, well done.
Aside from renaming the function and a few minor details in the notebook and docstrings, I don't have any major remarks.
View / edit / reply to this conversation on ReviewNB ColtAllen commented on 2024-10-21T12:55:05Z Suppress this warning so that it does not appear in the documentation ColtAllen commented on 2024-10-24T10:45:40Z Re-running the cell should clear it. |
View / edit / reply to this conversation on ReviewNB ColtAllen commented on 2024-10-21T12:55:05Z See PR review notes about renaming this method. If you're curious how this method is demonstrated with |
@DylanZammit I think this one is very close to the finish line. I think there are a couple of open comments from Colt, and then we are good to go. Please let us know if you need support :) |
Re-running the cell should clear it. View entire conversation on ReviewNB |
I saw two typos in the notebook ("ot keep" and "deposits" instead of "spending"), but ReviewNB isn't allowing me to post any more comments for some reason. I'm also curious about that DIV/0 warning with the MAP fit, and noticed an older version of |
Made all suggested changes:
I have still not investigated the DIV/0 error, however, I suspect it is due to numerical issues. Please let me know if you have any further suggestions. |
I'm not able to re-create the error on my 2023 M2 Macbook with identical
|
…_purchase' into beta_geo_expected_probability_no_purchase
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1094 +/- ##
=======================================
Coverage 95.61% 95.61%
=======================================
Files 39 39
Lines 4039 4063 +24
=======================================
+ Hits 3862 3885 +23
- Misses 177 178 +1 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work on the notebook and augmenting existing research with a more performant function derivation! If you ever want to link your PDF to the docstring references feel free to open another PR.
Description
The linked issue below describes the motivation and derivation of the newly introduced method. Only 2 files have been updated:
pymc_marketing/clv/models/beta_geo.py
: Introduction ofBetaGeoModel.expected_probability_no_purchase
, which implements the derivation in aforementioned document.docs/source/notebooks/bg_nbd.ipynb
: Includes an example of how to use it with some example customers.I might require guidance on how to implement unit tests for this new method. Other unit tests for the BetaGeo model seem to compare the output results of similar methods with the ones given by the lifetimes library. However, there is no corresponding functionality for the new proposed method.
Related Issue
(T, T+t]
#1093Checklist
Modules affected
Type of change
📚 Documentation preview 📚: https://pymc-marketing--1094.org.readthedocs.build/en/1094/