You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docstrings update in model_builder.py (pymc-devs#148)
* docstrings update in model_builder.py
* bringing back accidentally removed line from example
* Return posterior predictive samples from all chains in `ModelBuilder` (pymc-devs#140)
* Return posterior predictive samples from all chains
This fixes a bug where only values from one chain were returned.
It also refactors the prediction logic to reduce duplication, and
makes the output of predict_posterior() consistent in type and shape
with the output of pymc.sample_posterior_predictive().
* keep attributes even when computing posterior means
* Add/test combined arg, revert method order
* Fix import order.
---------
Co-authored-by: Max Joseph <[email protected]>
Co-authored-by: Thomas Wiecki <[email protected]>
* fixing merge conflicts
---------
Co-authored-by: Max Joseph <[email protected]>
Co-authored-by: Max Joseph <[email protected]>
Co-authored-by: Thomas Wiecki <[email protected]>
Copy file name to clipboardExpand all lines: pymc_experimental/model_builder.py
+30-9Lines changed: 30 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -133,8 +133,16 @@ def create_sample_input():
133
133
>>> 'target_accept': 0.95,
134
134
>>> }
135
135
>>> return data, model_config, sampler_config
136
-
"""
137
136
137
+
Returns
138
+
-------
139
+
data : dict
140
+
The data we want to train the model on
141
+
model_config : dict
142
+
A set of parameters for predictor distributions that allow to save and recreate the model
143
+
sampler_config : dict
144
+
A set of default settings for sampler config, customization of contents of sampler_config allows introducing new settings to the sampler
145
+
"""
138
146
raiseNotImplementedError
139
147
140
148
@abstractmethod
@@ -149,11 +157,17 @@ def build_model(
149
157
150
158
Required Parameters
151
159
----------
152
-
model_data - preformated data that is going to be used in the model.
153
-
For efficiency reasons it should contain only the necesary data columns, not entire available
154
-
dataset since it's going to be encoded into data used to recreate the model.
155
-
model_config - dictionary where keys are strings representing names of parameters of the model, values are
156
-
dictionaries of parameters needed for creating model parameters (see example in create_model_input)
160
+
model_data : dict
161
+
Preformated data that is going to be used in the model. For efficiency reasons it should contain only the necesary data columns,
162
+
not entire available dataset since it's going to be encoded into data used to recreate the model.
163
+
model_config : dict
164
+
Dictionary where keys are strings representing names of parameters of the model, values are dictionaries of parameters
165
+
needed for creating model parameters
166
+
167
+
See Also
168
+
--------
169
+
create_model_input : Creates all required input for the model builder based on the data given. Shows the examples of data structures on which the specific
data : Dictionary of string and either of numpy array, pandas dataframe or pandas Series
248
-
It is the data we need to train the model on.
261
+
data : dict
262
+
Dictionary of string and either of numpy array, pandas dataframe or pandas Series. It is the data we need to train the model on.
263
+
progressbar : bool
264
+
Specifies whether the fit progressbar should be displayed
265
+
random_seed : RandomState
266
+
Provides sampler with initial random seed for obtaining reproducible samples
267
+
**kwargs : Any
268
+
Custom sampler settings can be provided in form of keyword arguments. The recommended way is to add custom settings to sampler_config provided by
269
+
create_sample_input, because arguments provided in the form of kwargs will not be saved into the model, therefore will not be available after loading the model
0 commit comments