-
Notifications
You must be signed in to change notification settings - Fork 247
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
Allow MAP fitting for CLV models #130
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@@ -6,7 +6,6 @@ addopts = [ | |||
"-v", | |||
"--strict-markers", | |||
"--strict-config", | |||
"--cov=mmm", | |||
"--cov=pymmmc", | |||
"--cov=pymc_marketing", |
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.
CC @juanitorduz
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.
Not sure if it should be pymc-marketing
either :P
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 believe is pymc-marketing
...the coverage and tests seem running as expected on this PR right?
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.
What does this addopts do? Why was the previous mmm/ pymmmc fine, even after we changed the package name?
Continuation of incomplete 0527b87
93c80c6
to
7d3c720
Compare
7d3c720
to
9325c79
Compare
pymc_marketing/clv/models/basic.py
Outdated
with self.model: | ||
self._fit_result = pm.sample(*args, **kwargs) | ||
return self._fit_result | ||
|
||
def fit_MAP(self, **kwargs): | ||
"""Find model maximum a posterior using scipy optimizer""" |
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.
Does pm.find_MAP()
use scipy
under the hood? Also, looks like 'posteriori' was misspelled here.
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.
Yes it uses scipy
under the hood. Thanks for flagging the typo
Apart from the docstring typo, this looks good! We floated the idea of rolling both |
They return very similar objects, so that the summary statistic methods work the same. We could use the single
Do people like that more? I think I like it more. |
If the return objects are functionally equivalent, then this gets my vote. I only briefly tested ADVI when I started working on BTYD, but the posteriors it generated did not impress me. |
Bambi has an "inference_method" parameter in its .fit function. In mcmc, and vi, it also allows "nuts_numpyro" and "nuts_blackjax". Will the .fit function here allow sampling using jax too? |
The PyMC https://github.com/pymc-devs/pymc/pull/6422/files |
@ricardoV94 very cool. Thanks for the clarification. |
1. Remove last plot which made sense when using `distribution_customer_spend` but not `expected_customer_spend`. 2. Show example of MAP fitting
9325c79
to
12d873c
Compare
Updated to use a keyword in the user facing |
fit_MAP
to CLV models
Closes #99