pyriemann.estimation.Coherences¶
- class pyriemann.estimation.Coherences(window=128, overlap=0.75, fmin=None, fmax=None, fs=None, coh='ordinary')[source]¶
Estimation of squared coherence matrices.
Squared coherence matrices estimation [1]. This method will return a 4-d array with a squared coherence matrix estimation for each input and in each frequency bin of the FFT.
- Parameters:
- windowint, default=128
The length of the FFT window used for spectral estimation.
- overlapfloat, default=0.75
The percentage of overlap between window.
- fminfloat | None, default=None
the minimal frequency to be returned.
- fmaxfloat | None, default=None
The maximal frequency to be returned.
- fsfloat | None, default=None
The sampling frequency of the signal.
- coh{“ordinary”, “instantaneous”, “lagged”, “imaginary”}, default=”ordinary”
Coherence type, see
pyriemann.geometry.covariance.coherence().
- Attributes:
- freqs_ndarray, shape (n_freqs,)
If transformed, the frequencies associated to cospectra. None if
fsis None.
See also
Notes
Added in version 0.3.
References
[1]Instantaneous and lagged measurements of linear and nonlinear dependence between groups of multivariate time series: frequency decomposition R. Pascual-Marqui. Technical report, 2007.
- 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:
- selfCrossSpectra instance
The CrossSpectra 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, n_channels, n_freqs)
Cross-spectral matrices for each input and for each frequency bin.
- get_metadata_routing()¶
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
- routingMetadataRequest
A
MetadataRequestencapsulating 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.