class BoxDiscretizationModel

class deeptime.clustering.BoxDiscretizationModel(cluster_centers: ndarray, v0, v1, n_boxes)

Model produced by BoxDiscretization. Can be used to discretize and/or one-hot transform data.

Parameters:
  • cluster_centers (ndarray) – The cluster centers.

  • v0 (ndarray) – Lower left vertex of box.

  • v1 (ndarray) – Upper right vertex of box.

  • n_boxes (int) – Number of boxes.

Attributes

cluster_centers

Gets the cluster centers that were estimated for this model.

converged

Whether the estimation process converged.

dim

metric

The metric that was used.

n_clusters

The number of cluster centers.

Methods

copy()

Makes a deep copy of this model.

get_params([deep])

Get the parameters.

set_params(**params)

Set the parameters of this estimator.

transform(data[, n_jobs])

For each frame in data, yields the index of the closest point in cluster_centers.

transform_onehot(data[, n_jobs])

Transforms data into discrete states with subsequent one-hot encoding.

__call__(*args, **kwargs)

Call self as a function.

copy() Model

Makes a deep copy of this model.

Returns:

A new copy of this model.

Return type:

copy

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

transform(data, n_jobs=None) ndarray

For each frame in data, yields the index of the closest point in cluster_centers.

Parameters:
  • data ((T, d) ndarray) – frames

  • n_jobs (int, optional, default=None) – number of jobs to use for assignment

Returns:

discrete_trajectory – A discrete trajectory where each frame denotes the closest cluster center.

Return type:

(T, 1) ndarray

transform_onehot(data, n_jobs=None)

Transforms data into discrete states with subsequent one-hot encoding.

Parameters:
  • data (ndarray) – Input data

  • n_jobs (int or None, optional, default=None) – Number of jobs.

Returns:

one_hot – A (T, n_boxes) shaped array with one-hot encoded data.

Return type:

ndarray

property cluster_centers: ndarray

Gets the cluster centers that were estimated for this model.

Returns:

Array containing estimated cluster centers.

Return type:

np.ndarray

property converged: bool

Whether the estimation process converged. Per default this is set to False, which can also indicate that the model was created manually and does not stem from an Estimator directly.

Returns:

converged – Whether the clustering converged

Return type:

bool

property metric: str

The metric that was used.

Returns:

metric – Name of the metric that was used. The name is related to the implementation via the metric registry.

Return type:

str

property n_clusters: int

The number of cluster centers.

Returns:

The number of cluster centers.

Return type:

int