## 2 Methods
### EEG Data
#### 3.2.3 Classification Setup
Therefore, for the \(N\) trials, we get set of connectivity matrices \(\{\boldsymbol{\Lambda}^{\prime}_{n}\in\mathbb{R}^{C\times C\times 2}\}_{n=1}^{N}\). Then, we apply vector concatenation to \(\boldsymbol{\Lambda}^{\prime}_{n}\) to yield a vector \(\boldsymbol{\phi}_{n}\in\mathbb{R}^{1\times(C\times C\times 2)}\). After that, we stack the \(N\) vectors \(\boldsymbol{\phi}_{n}\) in order to obtain a single matrix \(\boldsymbol{\Phi}\in\mathbb{R}^{N\times(C\times C\times 2)}\) characterizing \(\Psi\) for the MI data. For the WM we follow the same steps, only that in this case we vary the values of \(f\) in the range from 4 Hz to 18 Hz, in 2 Hz steps, since oscillatory activity at those frequencies has been shown to play a role in the interactions between different brain regions during WM [50; 51]. Next, we define three bandwidths of interest \(\Delta f\in\{\theta\in[4-6],\alpha\in[8-12],\beta_{l}\in[14-18]\}\) Hz, which leads to a connectivity matrix \(\boldsymbol{\Lambda}^{\prime}\in\mathbb{R}^{C\times C\times 3}\) for each trial and ultimately to a matrix \(\boldsymbol{\Phi}\in\mathbb{R}^{N\times(C\times C\times 3)}\) characterizing \(\Psi\) for the WM data. Note that since the PSI is an antisymmetric connectivity measure, we only use the upper triangular part of the connectivity matrix associated with each trial to build \(\boldsymbol{\Phi}\). Feature Selection and Classification  
After characterizing the EEG data, either through real-valued or phase-based effective connectivity measures, we set up a subject-dependent classification system for the MI and WM databases. For the MI data, we do the following: Since the MI database has training and testing datasets, we divide our classification system into a training-validation stage and a testing stage. For the training-validation stage, we first specify a cross-validation scheme of  
Figure 4: Schematic representation of our overall classification setup. 10 iterations. For each iteration, 70% of the trials of the training dataset are randomly assigned to a training set and the remaining 30% to a validation set. Then, we use CKA (see Section 2.4) over the connectivity features obtained from the training set to generate a relevance vector \(\varrho\in[0,1]^{P}\), where \(P\) equals the number of features in \(\mathbf{\Phi}\). \(P\) varies according to the connectivity measure used to characterize the data. Then, we use \(\varrho\) to rank \(\mathbf{\Phi}\). Next, we select a varying percentage of the ranked features, from 5% to 100% in 5% steps, and input them to the classification algorithm. The features associated with the highest values of \(\varrho\) are input first, and as the percentage of features increases those associated with lower values of \(\varrho\) are progressively included. In this work, we use a support vector classifier (SVC) with an RBF kernel [52]. All classification parameters, including the percentage of discriminant features, are tuned at this stage through a grid search. We select the parameters according to the classification accuracy, aiming to improve the system's performance. Then, for the testing stage, we train an SVC using the connectivity features from all trials in the training dataset as well as the parameters found in the previous stage. Lastly, we quantify the performance of the trained system in terms of the classification accuracy, obtained after predicting the MI task class labels of the testing dataset from its connectivity features. The classification system we set up for the WM data closely resembles the one previously detailed for the MI data, with three changes. First, the WM database consists of one set of data for each subject, instead of two, so there is only a training-validation stage. Second, given the reduced number of trials available for each memory load level, each of the 10 iterations of the cross-validation scheme follows an 80-20% split for the training and validation sets (instead of a 70-30% split).