docs(bass): update notebook to the BassModel workflow#2630
Draft
anevolbap wants to merge 7 commits into
Draft
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Contributor
|
We will have to imediately port with pymc 6.0.0. Can we pause? |
BassModel.load left model_config as plain dicts after the JSON round-trip, so build_model crashed on any loaded model. Parse the config in __init__ like CLV does, and register Scaled in the TypeRegistry so the scaled market-potential prior round-trips too.
_data_setter filled y_obs with 1-D zeros, so out-of-sample prediction failed for multi-product models.
b3eb0f4 to
2bb08e5
Compare
Contributor
Author
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2630 +/- ##
==========================================
+ Coverage 94.19% 94.25% +0.06%
==========================================
Files 100 101 +1
Lines 15384 15505 +121
==========================================
+ Hits 14491 14615 +124
+ Misses 893 890 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Description
Rewrites
bass_example.ipynbaround theBassModelclass:model.fitwithmodel_config/sampler_config, theplot_*methods from #2628 (plot_decompositionuses the dual y-axes asked for in #1706), out-of-sample forecasting, a save/load round-trip, and MLflow autologging from #2624.create_bass_modelstays in the simulation section as the lower-level API.Writing the notebook surfaced two bugs, fixed here with regression tests:
BassModel.loadreturned plain dicts instead ofPriorobjects, so any loaded model crashed. Fixed withparse_model_configin__init__plus a serialization round-trip forScaledpriors.y_obsplaceholder.The notebook runs top to bottom with real sampling and passes the mocked CI runner. Stacked on #2624 and #2628; merging those first and rebasing shrinks this diff to the notebook plus the two fixes.
Checklist
📚 Documentation preview 📚: https://pymc-marketing--2630.org.readthedocs.build/en/2630/