# Diagnosing Schizophrenia Using Effective Connectivity of Resting-State EEG Data
## 2 Materials and Methods
### Machine Learning  
The dataset in this study consists of the STE features for all 132 subjects and their corresponding labels: label 1 for the 62 SCZs and label 2 for the 70 HCs. MLA employs a training set consisting of labeled samples from SCZ and HC subjects to the class of subjects. The most discriminating features, defined as features whose values differ between the SCZ and HC classes, were identified from a list of candidate features, using various types of feature selection algorithms. We need this step to avoid over-fitting, which impacts the classification performance. These selected features then define a feature space. The job of a classifier is to optimally partition the available training samples into two separate regions (i.e., an SCZ region and an HC region) in the feature space. The class of a previously unseen sample can then be determined by extracting the selected features from the sample and plotting the corresponding point in the feature space. The proximity of each subject's point,in the feature space, to the regions in this feature space occupied by others who are known to be either SCZ or HC, then determines that subject's class. In this study, we used the Relief algorithm [44] for selecting the most discriminating feature, which is noise-tolerant and robust to feature interactions. The key idea of the algorithm is to select features according to how their values are similar for the neighboring samples in the same class and different for the neighboring samples in different classes [44]. One repeatedly noted drawback of the Relief algorithm is that it does not effectively remove feature redundancies, i.e., it selects features without considering their correlation. However, unless two features are highly correlated (i.e., redundant), useful information may be lost when redundant features are removed [45; 46]. Furthermore, there is an inverse relationship between the correlation of EEG electrodes and their distance. In this study, since we used a low-density EEG set up with just 20 electrodes, the ECs between these electrodes are not highly correlated due to the long distance between them [47]. We used a newly developed consensus nested cross-validation (CN-CV) approach to avoid choosing dominant features among a few subjects [48]. CN-CV is an iterative process, wherein first, the subjects are divided into \(k\) (here \(k=5\)) outer folds with the same number of subjects for each class. Then, at each iteration, one particular fold is considered as a test fold and all the features associated with that fold are removed from the training set. The remaining \(k-1\) folds are then combined and divided into \(l\) (here \(l=5\)) inner folds. Then, at each fold \(l\) (here \(l=1,\,2,\,\ldots,\,5\)), all features with a positive score based on the Relief algorithm, that are more likely to be relevant to classification, are considered as the selected features for that fold. Consensus (common) features through all the \(l\) folds are then considered as the feature set for outer fold \(k\). The iterations repeat until all outer folds have been removed from the training set once. The structure of the CN-CV algorithm is analogous to the well-known nested CV(N-CV) [49], but unlike N-CV only feature selection is achieved in each inner fold. This makes the CN-CV algorithm more computationally efficient than the N-CV method that selects fewer irrelevant features [49]. We then selected the first \(N_{\rm r}\) features among all the selected features with the CN-CV approach that gives the highest generalized classification accuracy (averaged accuracy over all \(k\) outer folds) as the final selected features. The third step is to indicate the class (label) of subjects based on the selected features. Various types of classifiers are available for classifying biological signals.