coffeine.pipelines.make_filter_bank_classifier#

coffeine.pipelines.make_filter_bank_classifier(names: list[str], method: str = 'riemann', projection_params: dict | None = None, vectorization_params: dict | None = None, categorical_interaction: bool | None = None, scaling: BaseEstimator | None = None, estimator: BaseEstimator | None = None)#

Generate pipeline for classification with filter bank model.

Prepare filter bank models as used in [1]. These models take as input sensor-space covariance matrices computed from M/EEG signals in different frequency bands. Then transformations are applied to improve the applicability of linear regression techniques by reducing the impact of field spread.

In terms of implementation, this involves 1) projection (e.g. spatial filters) and 2) vectorization (e.g. taking the log on the diagonal).

Note

The resulting model expects as inputs data frames in which different covarances (e.g. for different frequencies) are stored inside columns indexed by names.

Other columns will be passed through by the underlying column transformers.

The pipeline also supports fitting categorical interaction effects after projection and vectorization steps are performed.

Note

All essential methods from [1] are implemented here. In practice, we recommend comparing `riemann’, `spoc’ and `diag’ as a baseline.

Parameters:
nameslist of str

The column names of the data frame corresponding to different covariances.

methodstr

The method used for extracting features from covariances. Defaults to 'riemann'. Can be 'riemann', 'lw_riemann', 'diag', 'log_diag', 'random', 'naive', 'spoc', 'riemann_wasserstein'.

projection_paramsdict | None

The parameters for the projection step.

vectorization_paramsdict | None

The parameters for the vectorization step.

categorical_interactionstr

The column in the input data frame containing a binary descriptor used to fit 2-way interaction effects.

scalingscikit-learn Transformer object | None

Method for re-rescaling the features. Defaults to None. If None, StandardScaler is used.

estimatorscikit-learn Estimator object.

The estimator object. Defaults to None. If None, LogisticRegression is performed with default values.

References

[1] (1,2)

D. Sabbagh, P. Ablin, G. Varoquaux, A. Gramfort, and D.A. Engemann. Predictive regression modeling with MEG/EEG: from source power to signals and cognitive states. NeuroImage, page 116893,2020. ISSN 1053-8119. https://doi.org/10.1016/j.neuroimage.2020.116893