-
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
Add plot_expected_purchases_over_time
function
#1115
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
pymc_marketing/clv/plotting.py
Outdated
ylabel: str = "Purchases", | ||
ax: plt.Axes | None = None, | ||
**kwargs, | ||
): |
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.
Can we add the return type hint plt.Axes
(or shall we return the Figure object instead?, we do this for the MMM plots)
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.
All CLV plots return plt.Axes
, but I do have some big plans coming up for this module, so we can leave it as-is for now.
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.
I really like this type of diagnostic plots!
I left some suggestions :D
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.
Overall looks good. Just some comments on the verbiage
Thanks @ColtAllen ! |
plot_expected_purchases
functionplot_expected_purchases_over_time
function
Description
This PR consolidates the
plot_cumulative_transactions
andplot_incremental_transactions
functions fromlifetimes
into a single plotting function, which is very useful for model evaluation:So useful in fact that when I added it to the Quickstart, it revealed a data discrepancy causing model bias! I left it in the notebook because I felt like it was a teachable moment, but at the same time we're showcasing this library with a skewed model. I'm curious to hear your thoughts on this.
I added
plt.clf()
to the plotting function to reset thepyplot
object between plots, which is useful when logging multiple figures to MLflow. I also took the opportunity to make a few other revisions to the Quickstart, such as use of thePrior
class in model configs and a watermark.Related Issue
lifetimes
#326Checklist
Modules affected
Type of change
📚 Documentation preview 📚: https://pymc-marketing--1115.org.readthedocs.build/en/1115/