class Estimator¶
- class deeptime.base.Estimator(model=None)¶
Base class of all estimators
- Parameters:
model (Model, optional, default=None) – A model which can be used for initialization. In case an estimator is capable of online learning, i.e., capable of updating models, this can be used to resume the estimation process.
Attributes
Property reporting whether this estimator contains an estimated model.
Shortcut to
fetch_model()
.Methods
Yields the estimated model.
fit
(data, **kwargs)Fits data to the estimator's internal
Model
and overwrites it.fit_fetch
(data, **kwargs)Fits the internal model on data and subsequently fetches it in one call.
get_params
([deep])Get the parameters.
set_params
(**params)Set the parameters of this estimator.
- fetch_model() Optional[Model] ¶
Yields the estimated model. Can be None if
fit()
was not called.- Returns:
model – The estimated model or None.
- Return type:
Model or None
- abstract fit(data, **kwargs)¶
Fits data to the estimator’s internal
Model
and overwrites it. This way, every call tofetch_model()
yields an autonomous model instance. Sometimes apartial_fit
method is available, in which case the model can get updated by the estimator.- Parameters:
data (array_like) – Data that is used to fit a model.
**kwargs – Additional kwargs.
- Returns:
self – Reference to self.
- Return type:
- fit_fetch(data, **kwargs)¶
Fits the internal model on data and subsequently fetches it in one call.
- Parameters:
data (array_like) – Data that is used to fit the model.
**kwargs – Additional arguments to
fit()
.
- Returns:
The estimated model.
- Return type:
model
- get_params(deep=False)¶
Get the parameters.
- Returns:
params – Parameter names mapped to their values.
- Return type:
mapping of string to any
- set_params(**params)¶
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:
**params (dict) – Estimator parameters.
- Returns:
self – Estimator instance.
- Return type:
object
- 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()
.