class BoxDiscretization¶
- class deeptime.clustering.BoxDiscretization(dim: int, n_boxes, v0=None, v1=None)¶
An n-dimensional box discretization of Euclidean space.
It spans an n-dimensional grid based on linspaces along each axis which is then used as cluster centers. The linspaces are bounded either by the user (attributes
v0
andv1
) or estimated from data.- Parameters:
dim (int) – Dimension of the box discretization.
n_boxes (int or list of int) – Number of boxes per dimension of - if given as single integer - for all dimensions.
v0 (array or None, optional, default=None) – Lower left vertex of the box discretization. If not given this is estimated from data.
v1 (array or None, optional, default=None) – Upper right vertex of the box discretization. If not given this is estimated from data.
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[BoxDiscretizationModel] ¶
Yields the estimated model.
- Returns:
model – The model.
- Return type:
BoxDiscretizationModel or None
- fit(data: ndarray, **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()
.