pymc-marketing
pymc-marketing copied to clipboard
Add optimization notebook
Initial version of the optimization notebook. I have not yet added all the "bells and whistles" that are possible, because I want to get feedback on the core first. Then we can make it pretty.
One thing that I think can immediately be improved is to replace much of the manual contribution/ROAS calculation code with things like mmm.channel_contributions_forward_pass()
etc. These helper functions didn't exist when the notebook was first created.
Also, I had planned on omitting all the MMM example notebook code, but realized I need to serialize the model, the inferenceData object, and the input data (and possibly more?). So I just kept the code but stripped it down to the essentials. Keeping all these cells also prevents "syncing" issues between this notebook and the MMM example notebook.
Todos:
- [ ] Replace objective function code with pymc-marketing functionality as possible
- [ ] Make objective function a compiled pytensor function to avoid
eval()
s - [ ] Add additional exploration of optimization results (e.g., risk attitudes, diversification penalty, etc.)
:books: Documentation preview :books:: https://pymc-marketing--358.org.readthedocs.build/en/358/
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 94.58%. Comparing base (
ac645c9
) to head (3b5c92a
).
Additional details and impacted files
@@ Coverage Diff @@
## main #358 +/- ##
=======================================
Coverage 94.58% 94.58%
=======================================
Files 33 33
Lines 3378 3378
=======================================
Hits 3195 3195
Misses 183 183
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This seems stale. Shall we close and turn into smaller issues? Thoughts @cluhmann @juanitorduz
This notebook has many great ideas that I would like to explore further. Can we leave it open while I try to get some time? Maybe we can add a special label?
Or actually, as it is a dev notebook, can we merge it into the dev folder (as the clv dev ones)?
Happy to help hammer this into something (more) useful.
How about merge in since it is dev notebook and then create an issue or two?
Fine with me.