-
-
Notifications
You must be signed in to change notification settings - Fork 52
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 build_model
abstractmethod to ModelBuilder
#142
Conversation
build_model
abstractmethod to ModelBuilder
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.
LGTM, any specific thing you need input on?
pymc_experimental/model_builder.py
Outdated
>>> 'obs_error': 2, | ||
>>> } | ||
>>> 'a' : { | ||
>>> 'a_loc': 7, |
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.
Should this not just be loc
, the a
seems redundant.
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.
true, good catch
pymc_experimental/model_builder.py
Outdated
@@ -191,7 +220,7 @@ def load(cls, fname: str): | |||
data=idata.fit_data.to_dataframe(), | |||
) | |||
model_builder.idata = idata | |||
model_builder.build() | |||
model_builder.idata = model_builder.fit() |
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 if the model was already fit?
👍 |
changes to ModelBuilder that are required for full integration with MMM, the final shape is still open for discussion.
main changes:
-build_model moved out of constructor of baseMMM and called in fit() in model_builder
-abstract definition of build_model added to model_builder
-abstract definition of _serialisable_model_config added to model_builder (solves the unserialisability of time series
-save now requires model to be fit first
-added test checking that RuntimeError is raised if save is called before fit
-model is not build at initialisation of MMM, but with first fit, reason is that chain calling constructors was causing issues with object creation timing resulting in not reliable inheritance