v2.0.0
Loading...
Searching...
No Matches
DECODINGLIB::DecodingSpoc Class Reference

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

Detailed Description

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.

See also
DECODINGLIB, mne.decoding.SPoC

Definition at line 89 of file decoding_spoc.h.

Member Enumeration Documentation

◆ TransformMode

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.

Constructor & Destructor Documentation

◆ DecodingSpoc()

DecodingSpoc::DecodingSpoc ( int nComponents = 4,
TransformMode transformInto = TransformMode::AveragePower,
bool useLog = true )
explicit

Constructs a SPoC decoder.

Parameters
[in]nComponentsNumber of components. Default: 4.
[in]transformIntoFeature extraction mode. Default: AveragePower.
[in]useLogIf true and transformInto == AveragePower, apply log transform.

Definition at line 63 of file decoding_spoc.cpp.

Member Function Documentation

◆ filters()

const MatrixXd & DecodingSpoc::filters ( ) const
Returns
Spatial filters (n_components × n_channels).

Definition at line 207 of file decoding_spoc.cpp.

◆ fit()

void DecodingSpoc::fit ( const std::vector< Eigen::MatrixXd > & epochs,
const Eigen::VectorXd & y )

Fit SPoC from epoch data and a continuous target variable.

Parameters
[in]epochsVector of epoch matrices, each (n_channels × n_times).
[in]yContinuous target variable (one value per epoch).

Definition at line 74 of file decoding_spoc.cpp.

◆ fitTransform()

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.

◆ isFitted()

bool DecodingSpoc::isFitted ( ) const
Returns
True if the model has been fitted.

Definition at line 247 of file decoding_spoc.cpp.

◆ mean()

const VectorXd & DecodingSpoc::mean ( ) const
Returns
Mean band power per component (computed during fit).

Definition at line 227 of file decoding_spoc.cpp.

◆ patterns()

const MatrixXd & DecodingSpoc::patterns ( ) const
Returns
Spatial patterns (n_channels × n_components).

Definition at line 217 of file decoding_spoc.cpp.

◆ stddev()

const VectorXd & DecodingSpoc::stddev ( ) const
Returns
Standard deviation of band power per component.

Definition at line 237 of file decoding_spoc.cpp.

◆ transform()

MatrixXd DecodingSpoc::transform ( const std::vector< Eigen::MatrixXd > & epochs) const

Transform epoch data using the fitted SPoC filters.

Parameters
[in]epochsVector of epoch matrices.
Returns
Feature matrix.

Definition at line 162 of file decoding_spoc.cpp.


The documentation for this class was generated from the following files: