Neural oscillatory state regression¶
A simple pipeline used for neural oscillatory state regression is named OscillatoryRegressionExample.pyp and can be found in the examples\ folder:

The main node of this pipeline is the Source Power Comodulation (SPoC) filter, which is used to retrieve the components or patterns in the EEG data. Available such methods in Neuropype are Source Power Comodulation (SPoC) and Filterbank SPoC which are targeted for regression algorithms.
This pipeline can be divided into 4 main parts, which we discuss in the following:
Data Acquisition¶
Includes : Import Data, LSL Input and Inject Calibration Data nodes
In general, the data is communicated in and out of the pipeline through LSL Input and LSL Output nodes. This is mostly the case when you are running a pipeline on the streamed data online. However. for testing and developing purposes you may want to run the process offline using a prerecorded file. The Import Data nodes (here titled Import Test Data and Import Calibration Data) are used to connect the pipeline to a file.
As discussed in getting started notes, the recorded data can also be streamed and sent via a combination of LSL Output and LSL Input into the pipeline. This can be achieved by the following combination of nodes:

If you are sending markers make sure to check the
send markeroption inLSL outputnode.

The Inject Calibration Data node is used to pass the initial calibration data into the pipeline before the actual data is processed. The calibration data, Calib Data, is used by adaptive and machine learning algorithms to train and set their parameters initially. The main data is connected to the Streaming Data port.
In case you would like to train and test your pipeline using files (without using streaming node), you need to set the
Delay streaming packetsin theInject Calibration Datanode. This enables this node to buffer the test data that is pushed into it for one cycle and transfer it to the output port in the next cycle. It should be noted that the first cycle is used to push the calibration data through the pipeline.

Data Preprocessing¶
Includes: Assign Targets, Select Range, FIR filter and Segmentation nodes
The Assign Target node is mostly useful for the supervised learning algorithms, where target values are assigned to specific markers present in the EEG signal. For this pipeline, where the valence values are estimated based on the ridge regression, the target values relate to the valence values for each emotion. In order for this node to operate correctly you need to know the label for the markers in the data.
The Select Range node is used to specify certain parts of the data stream. For example if we have a headset that contain certain bad channels, you can manually remove them here.
The FIR Filter node is used to remove the unwanted signals components outside the EEG signal frequencies, e.g. to keep the 8-28Hz frequency window.
The Segmentation node performs the epoching process, where the streamed data is divided into segments of the pre-defined window-length around markers on the EEG data.
In
Segmentationnode, the epoching process can be either done relative to the marker or the time window. When Processing a big data buffer, you should set the epoching relative to markers and while processing the streaming data, you should set it to sliding which chooses a single window at the end of the data.
Feature Extraction¶
Includes: Filter Bank Source Power Comodulation (FBSPoC) node
The Filter Bank Source Power Comodulation (FBSPoC) node is used to decompose the EEG data into a set of source components, this decomposition is guided by using the information in the target variable.
Regression¶
Includes: Ridge Regression and Measure Loss
The Ridge Regression node is used to solve the regression model where the loss function is the linear least squares function and regularization is given by the l2-norm. The regularization effect can be controlled by alphas values which are regularization weights.
The Measure Loss node is used to measure various performance criteria. For example, you can use the MSE (mean-squared error) or MAE (mean absolute error) etc.
Copyright (c) Syntrogi Inc. dba Intheon. All Rights Reserved.