PIEModel.fit#
- PIEModel.fit(X, y=None, *, method='mcmc', progressbar=None, random_seed=None, sample_kwargs=None, **kwargs)[source]#
Fit a model using the data passed as a parameter.
Thin wrapper around
ModelFitter.fit()supporting the X/y data convention. Sets attrs to inference data of the model.- Parameters:
- Xarray_like |
array,shape(n_obs,n_features) The training input samples. If scikit-learn is available, array-like, otherwise array.
- yarray_like |
array,shape(n_obs,) The target values (real numbers). If scikit-learn is available, array-like, otherwise array.
- method
str Method used to fit the model. One of
"mcmc","map","demz","advi"or"fullrank_advi". SeeModelFitter.fit().- progressbarbool, optional
Specifies whether the fit progress bar should be displayed. Defaults to True.
- random_seed
Optional[RandomState] Provides sampler with initial random seed for obtaining reproducible samples.
- sample_kwargs
dict, optional Only used by the variational methods; forwarded to
Approximation.sample.- **kwargs
Any Custom sampler settings can be provided in form of keyword arguments.
- Xarray_like |
- Returns:
- self
xr.DataTree Returns inference data of the fitted model.
- self
Examples
model = MyModel() idata = model.fit(X, y) Auto-assigning NUTS sampler... Initializing NUTS using jitter+adapt_diag...