folie.ELBOEstimator

class folie.ELBOEstimator(model=None, transition=None, **kwargs)[source]

Maximize the Evidence lower bound. Similar to EM estimation but the expectation is realized inside the minimization loop

fetch_model() Model | None[source]

Yields the estimated model. Can be None if fit() was not called.

Returns:
modelModel or None

The estimated model or None.

fit(data, minimizer=None, coefficients0=None, use_jac=True, callback=None, minimize_kwargs={'method': 'L-BFGS-B'}, **kwargs)[source]

Fits data to the estimator’s internal Model and overwrites it. This way, every call to fetch_model() yields an autonomous model instance. Sometimes a partial_fit method is available, in which case the model can get updated by the estimator.

Parameters:
dataarray_like

Data that is used to fit a model.

**kwargs

Additional kwargs.

Returns:
selfEstimator

Reference to self.

fit_fetch(data, **kwargs)[source]

Fits the internal model on data and subsequently fetches it in one call.

Parameters:
dataarray_like

Data that is used to fit the model.

**kwargs

Additional arguments to fit().

Returns:
model

The estimated model.

get_params(deep=False)[source]

Get the parameters.

Returns:
paramsmapping of string to any

Parameter names mapped to their values.

set_params(**params)[source]

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object.

Parameters:
**paramsdict

Estimator parameters.

Returns:
selfobject

Estimator instance.

property has_model: bool

Property reporting whether this estimator contains an estimated model. This assumes that the model is initialized with None otherwise.

Type:

bool

property model

Shortcut to fetch_model().