pyriemann.estimation.TimeDelayCovariances

class pyriemann.estimation.TimeDelayCovariances(delays=4, estimator='scm', **kwds)

Estimation of covariance matrices with time delay matrices.

Time delay covariance matrices are useful to catch spectral dynamics of the signal, similarly to the CSSP method [1]. It is done by concatenating time delayed version of the signal before covariance estimation.

Parameters:
delaysint | list of int, default=4

The delays to apply for the Hankel matrices. If int, it use a range of delays up to the given value. A list of int can be given.

estimatorstring, default=”scm”

Covariance matrix estimator, see pyriemann.utils.covariance.covariances().

**kwdsdict

Any further parameters are passed directly to the covariance estimator.

Attributes:
Xtd_ndarray, shape (n_matrices, n_channels x n_delays, n_times)

Time delay multi-channel time-series, where n_delays is equal to: delays when it is a int, and 1 + len(delays) when it is a list.

References

[1]

Spatio-spectral filters for improving the classification of single trial EEG S. Lemm, B. Blankertz, B. Curio, K-R. Muller. IEEE Transactions on Biomedical Engineering 52(9), 1541-1548, 2005.

__init__(delays=4, estimator='scm', **kwds)

Init.

fit(X, y=None)

Fit.

Do nothing. For compatibility purpose.

Parameters:
Xndarray, shape (n_matrices, n_channels, n_times)

Multi-channel time-series.

yNone

Not used, here for compatibility with sklearn API.

Returns:
selfTimeDelayCovariances instance

The TimeDelayCovariances instance.

fit_transform(X, y=None)

Fit and transform in a single function.

Parameters:
Xndarray, shape (n_matrices, n_channels, n_times)

Multi-channel time-series.

yNone

Not used, here for compatibility with sklearn API.

Returns:
X_newndarray, shape (n_matrices, n_channels x n_delays, n_channels x n_delays)

Time delay covariance matrices, where n_delays is equal to: delays when it is a int, and 1 + len(delays) when it is a list.

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Returns:
routingMetadataRequest

A MetadataRequest encapsulating routing information.

get_params(deep=True)

Get parameters for this estimator.

Parameters:
deepbool, default=True

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns:
paramsdict

Parameter names mapped to their values.

set_output(*, transform=None)

Set output container.

See Introducing the set_output API for an example on how to use the API.

Parameters:
transform{“default”, “pandas”, “polars”}, default=None

Configure output of transform and fit_transform.

  • “default”: Default output format of a transformer

  • “pandas”: DataFrame output

  • “polars”: Polars output

  • None: Transform configuration is unchanged

Added in version 1.4: “polars” option was added.

Returns:
selfestimator instance

Estimator instance.

set_params(**params)

Set the parameters of this estimator.

The method works on simple estimators as well as on nested objects (such as Pipeline). 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:
selfestimator instance

Estimator instance.

transform(X)

Estimate the time delay covariance matrices.

Parameters:
Xndarray, shape (n_matrices, n_channels, n_times)

Multi-channel time-series.

Returns:
X_newndarray, shape (n_matrices, n_channels x n_delays, n_channels x n_delays)

Time delay covariance matrices, where n_delays is equal to: delays when it is a int, and 1 + len(delays) when it is a list.