class KoopmanWeightingEstimator

class deeptime.covariance.KoopmanWeightingEstimator(lagtime, epsilon=1e-06, ncov='inf')

Computes Koopman operator and weights that can be plugged into the Covariance estimator. The weights are determined by the procedure described in [1].

Parameters:
  • lagtime (int) – The lag time at which the operator is estimated.

  • epsilon (float, optional, default=1e-6) – Truncation parameter. Eigenvalues with norms smaller than this cutoff will be removed.

  • ncov (int or str, optional, default=infinity) – Depth of moment storage. Per default no moments are collapsed while estimating covariances, perform aggregation only at the very end after all data has been processed.

References

Attributes

has_model

Property reporting whether this estimator contains an estimated model.

lagtime

The lagtime at which the Koopman operator is estimated.

model

Shortcut to fetch_model().

Methods

fetch_model()

Finalizes the model.

fit(data[, lagtime])

Fits a new model.

fit_fetch(data, **kwargs)

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

fit_transform(data[, fit_options, ...])

Fits a model which simultaneously functions as transformer and subsequently transforms the input data.

get_params([deep])

Get the parameters.

partial_fit(data)

Updates the current model using a chunk of data.

set_params(**params)

Set the parameters of this estimator.

transform(data, **kw)

Computes weights for a chunk of data.

__call__(*args, **kwargs)

Call self as a function.

fetch_model() KoopmanWeightingModel

Finalizes the model.

Returns:

koopman_model – The Koopman model, in particular containing operator and weights.

Return type:

KoopmanWeightingModel

fit(data, lagtime=None, **kw)

Fits a new model.

Parameters:
  • data ((T, d) ndarray) – The input data.

  • lagtime (int, optional, default=None) – Optional override for estimator’s lagtime.

  • **kw – Ignored keyword args for scikit-learn compatibility.

Returns:

self – Reference to self.

Return type:

KoopmanWeightingEstimator

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

fit_transform(data, fit_options=None, transform_options=None)

Fits a model which simultaneously functions as transformer and subsequently transforms the input data. The estimated model can be accessed by calling fetch_model().

Parameters:
  • data (array_like) – The input data.

  • fit_options (dict, optional, default=None) – Optional keyword arguments passed on to the fit method.

  • transform_options (dict, optional, default=None) – Optional keyword arguments passed on to the transform method.

Returns:

output – Transformed data.

Return type:

array_like

get_params(deep=False)

Get the parameters.

Returns:

params – Parameter names mapped to their values.

Return type:

mapping of string to any

partial_fit(data)

Updates the current model using a chunk of data.

Parameters:

data ((T, d) ndarray) – A chunk of data.

Returns:

self – Reference to self.

Return type:

KoopmanWeightingEstimator

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, **kw)

Computes weights for a chunk of data. This requires that a model was fit().

Parameters:
  • data ((T, d) ndarray) – A chunk of data.

  • **kw – Ignored kwargs.

Returns:

weights – Koopman weights.

Return type:

(T, 1) ndarray

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 lagtime: int

The lagtime at which the Koopman operator is estimated.

Getter:

Yields the currently configured lagtime.

Setter:

Sets a new lagtime, must be >= 0.

Type:

int

property model

Shortcut to fetch_model().