coffeine.spatial_filters.ProjCommonSpace#

class coffeine.spatial_filters.ProjCommonSpace(scale: float = 1.0, n_compo: int | str = 'full', reg: float = 1e-15)#

Project SPD matrix to common subspace (PCA).

Needed to define Riemannian metrics with rank deficient inputs as described in [1].

Parameters:
n_compoint

The size of the subspace to project onto.

random_statefloat | np.random.RandomState

The random state.

scalefloat | ‘auto’

Optional normalization that can be applied to the covariance. If float, the value is directly used as a scaling factor. If auto, scaling is obtained by 1 devided by the average of the trace across covariances.

regfloat (defaults to 1e-15)

A regularization factor applied in subspace by reg * identity matrix. The number is chose to be small and numerically stabilizing, assuming EEG input scaled in volts. This is sensitive to the scale of the input and may be different for MEG or other data types. Please check.

References

[1]

Sabbagh, D., Ablin, P., Varoquaux, G., Gramfort, A. and Engemann, D.A., 2019. Manifold-regression to predict from MEG/EEG brain signals without source modeling. Advances in Neural Information Processing Systems, 32.