coffeine.pipelines.make_filter_bank_transformer#
- coffeine.pipelines.make_filter_bank_transformer(names: list[str], method: str = 'riemann', projection_params: dict | None = None, vectorization_params: dict | None = None, kernel: str | Pipeline | None = None, combine_kernels: str | Pipeline | None = None, categorical_interaction: bool | None = None)#
Generate pipeline for filterbank models.
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.
- kernelNone | ‘gaussian’ | sklearn.Pipeline
The Kernel option for kernel regression. If ‘gaussian’, a Gaussian Kernel will be added per column and the results will be summed over frequencies. If sklearn.pipeline.Pipeline is passed, it should return a meaningful kernel.
- combine_kernelsNone | ‘sum’ | sklearn.pipeline.Pipeline
If kernel is used and multiple columns are defined, this option determines how a combined kernel is constructed. ‘sum’ adds the kernels with equal weights. A custom pipeline pipeline can be passed to implement alternative rules.
- categorical_interactionstr
The column in the input data frame containing a binary descriptor used to fit 2-way interaction effects.
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