SpectrallyWeightedCommonSpatialPattern¶
Extract spatio-spectral signal components whose variance optimally discriminates between two conditions.
Spec-CSP generalizes the basic CSP method to include spectral filters, and like CSP it can be used as an adaptive preprocessing step for a multichannel signal, such as EEG, EMG, or MEG, whose variance shall subsequently be used in a classification setup (e.g., to predict some binary target variable, for instance in order to discriminate between two possible cognitive states). The resulting components will usually yield better spectral features than the raw channels, leading to better classification accuracy. This node will calibrate itself if it receives a non-streaming (offline) chunk that has a time, space, and instance axis, and which has a target value for each instance (similarly to how machine learning nodes operate). Instances correspond to labeled trials, the space axis represents the channels which are being filtered, and time are the time points of each trial segment. Spec-CSP should be preceded at least by a highpass or bandpass filter (e.g., FIR or IIR prior to segmentation). Spec-CSP only works for two classes. Spec-CSP is a state-of-the-art spatio-spectral filtering method, and has been shown to be on par with alternative methods such as CSSP and CSSSP. Another spectral alternative is Filter-Bank Common Spatial Patterns (FBCSP). Since the method learns a good spectral filter by itself, it can be used in cases where the relevant frequency band is not known, and as such it can be useful in settings where there is little established a priori knowledge on those bands, for instance EEG collected in non-traditional tasks. Tip: a continuous time series with markers can be segmented into multiple labeled trials / segments using the Assign Target Markers node followed by the Segmentation node. Version 1.0.0
Ports/Properties¶
data¶
Data to process.
cond_field¶
The name of the instance data field that contains the conditions to be discriminated. This parameter will be ignored if the packet has previously been processed by a DescribeStatisticalDesign node.
nof¶
Number of spatio-spectral pattern pairs to compute. This determines the number of output channels (which is 2x this value) and thus the dimensionality of the feature space. Typical values are 2-4; while one can generate more features (up to the number of input channels), these will be increasingly less useful to the classifier.
shrinkage¶
Shrinkage coefficient for covariance matrix estimation.
prior_freq_range¶
A priori choice of relevant frequency band. The method will find optimal spectral weightings within that band.
reg_param_p¶
Regularization parameter p. Can be tuned in the range -1..+1 if desired, but the default value is a good choice.
reg_param_q¶
Regularization parameter q. Can be tuned in the range 0..4 if desired, but the default value is a good choice.
iterations¶
Number of iterations for spatio-spectral filter optimization. Should not be lower than 3, but higher values have not been shown to be effective.
spectrum_method¶
Method for calculating the spectral weighting. The Welch and Multitaper methods, respectively, allow for controlling the smoothness of the spectrum, which can yield better-behaved spectral filters.
min_fft_size¶
Minimum size of the FFT used in spectrum calculation. The chosen value is the greater of this and the next power of 2 greater than the length of the signal.
multitaper_time_halfbandwidth_product¶
Spectral smoothing parameter for multi-taper. Technically this is the time-halfbandwidth product, and typical values lie in the range of 2.5 to 5 (in increments of 0.5)
multitaper_num_tapers¶
Number of tapers in multi-taper method. The default is 2 times the time-halfbandwidth product minus 1.
welch_window_length¶
Length of overlapped windows in case of Welch spectral estimation, can be either in samples or seconds. Using a smaller value (e.g., 1/4-1/8th of the chunk length) yields a smoother spectrum. The default is 1/2 of the chunk length.
welch_window_unit¶
Unit in which the window length is given.
welch_overlap_length¶
Amount of overlap of successive windows in Welch method, it can be either in samples, seconds or even percentage of the window length. The default is half of the window length.
epsilon¶
Small value to prevent division by zero. This is only needed on challenging data.
welch_overlap_unit¶
Unit in which the overlap window length is given.
initialize_once¶
Do not recalibrate on subsequent offline chunks, even if they include target labels. If False, this node will recalibrate itself on any offline chunk that has data plus target labels.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.