Source Power Comodulation decoder for continuous-target regression on band-power. More...
#include <decoding_spoc.h>
Public Types | |
| enum class | TransformMode { AveragePower , CspSpace } |
Public Member Functions | |
| DecodingSpoc (int nComponents=4, TransformMode transformInto=TransformMode::AveragePower, bool useLog=true) | |
| void | fit (const std::vector< Eigen::MatrixXd > &epochs, const Eigen::VectorXd &y) |
| Eigen::MatrixXd | transform (const std::vector< Eigen::MatrixXd > &epochs) const |
| Eigen::MatrixXd | fitTransform (const std::vector< Eigen::MatrixXd > &epochs, const Eigen::VectorXd &y) |
| const Eigen::MatrixXd & | filters () const |
| const Eigen::MatrixXd & | patterns () const |
| const Eigen::VectorXd & | mean () const |
| const Eigen::VectorXd & | stddev () const |
| bool | isFitted () const |
Source Power Comodulation decoder for continuous-target regression on band-power.
Estimates a bank of spatial filters whose log band-power envelope is maximally correlated with a continuous trial-level target. The fit builds the unweighted trial-mean covariance and a target-weighted covariance from centred labels, solves the resulting generalised eigenvalue problem, and keeps the top n_components eigenvectors as filters and the columns of their pseudoinverse as the corresponding activation patterns. As with CSP, the patterns — not the filters — are the quantity that should be plotted as topographies when interpreting which cortical sources drive the regression, in line with Haufe et al. 2014.
After fit the decoder behaves as a deterministic feature extractor. AveragePower returns one (optionally log- or z-scored) band-power value per component and epoch, which plugs directly into a linear regressor; CspSpace returns the time- resolved filtered signal, useful when the downstream model consumes envelopes or instantaneous phase. Inputs must be epoched and already filtered in the relevant frequency band; the target vector \(z\) is a real-valued vector of length n_epochs.
mne.decoding.SPoC Definition at line 89 of file decoding_spoc.h.
|
strong |
Transform mode for the SPoC output.
| Enumerator | |
|---|---|
| AveragePower | Return average band power per component. |
| CspSpace | Return data projected into SPoC space. |
Definition at line 96 of file decoding_spoc.h.
|
explicit |
Constructs a SPoC decoder.
| [in] | nComponents | Number of components. Default: 4. |
| [in] | transformInto | Feature extraction mode. Default: AveragePower. |
| [in] | useLog | If true and transformInto == AveragePower, apply log transform. |
Definition at line 63 of file decoding_spoc.cpp.
| const MatrixXd & DecodingSpoc::filters | ( | ) | const |
Definition at line 207 of file decoding_spoc.cpp.
| void DecodingSpoc::fit | ( | const std::vector< Eigen::MatrixXd > & | epochs, |
| const Eigen::VectorXd & | y ) |
Fit SPoC from epoch data and a continuous target variable.
| [in] | epochs | Vector of epoch matrices, each (n_channels × n_times). |
| [in] | y | Continuous target variable (one value per epoch). |
Definition at line 74 of file decoding_spoc.cpp.
| MatrixXd DecodingSpoc::fitTransform | ( | const std::vector< Eigen::MatrixXd > & | epochs, |
| const Eigen::VectorXd & | y ) |
Fit and transform in one step.
Definition at line 198 of file decoding_spoc.cpp.
| bool DecodingSpoc::isFitted | ( | ) | const |
Definition at line 247 of file decoding_spoc.cpp.
| const VectorXd & DecodingSpoc::mean | ( | ) | const |
Definition at line 227 of file decoding_spoc.cpp.
| const MatrixXd & DecodingSpoc::patterns | ( | ) | const |
Definition at line 217 of file decoding_spoc.cpp.
| const VectorXd & DecodingSpoc::stddev | ( | ) | const |
Definition at line 237 of file decoding_spoc.cpp.
| MatrixXd DecodingSpoc::transform | ( | const std::vector< Eigen::MatrixXd > & | epochs | ) | const |
Transform epoch data using the fitted SPoC filters.
| [in] | epochs | Vector of epoch matrices. |
Definition at line 162 of file decoding_spoc.cpp.