# EEG Feature Extraction Using Genetic Programming for the Classification of Mental States
## 4 Experimentation and Results
\begin{table}
\begin{tabular}{c c c c c c c c c c c c c} \hline \hline
**1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** & **10** & **11** & **12** & **13** \\ \hline
1 & - & 0.5309 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0290 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\
2 & 0.4484 & - & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0303 & 0.0000 & 0.0000 & 0.0000 \\
3 & **0.0000** & **0.0000** & - & 0.0000 & 0.0000 & 0.0290 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\
4 & 0.0000 & 0.0000 & 0.0000 & - & 0.1545 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0001 & 0.0000 & 0.0000 \\
5 & 0.0000 & 0.0000 & 0.0000 & 0.0521 & - & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0036 & 0.0000 & 0.0000 \\
6 & 0.0000 & 0.0000 & 0.0284 & 0.0000 & 0.0000 & - & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\
7 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & - & 0.0000 & 0.0000 & 0.0290 & 0.0036 & 0.0000 & 0.0000 \\
8 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & - & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\
9 & 0.3501 & 0.8996 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & - & 0.0000 & 0.0000 & 0.0000 & 0.0000 \\
10 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0012 & 0.0000 & 0.0000 & - & 0.0000 & 0.0000 & 0.0000 \\
11 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0011 & 0.0000 & 0.0012 & 0.0000 & 0.0000 & - & 0.0000 & 0.0000 \\
12 & 0.0000 & 0.0000 & 0.0001 & 0.0000 & 0.0232 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & - & 0.0000 \\
13 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.0000 & 0.7784 & 0.0007 & 0.0000 & - \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Statistical pairwise tests corresponding to the testing performance. The upper triangular matrix encloses the \(p\)-values for a two-sample Kolmogorov–Smirnov test, and the lower triangular matrix consists of the \(p\)-values for a Wilcoxon rank sum test. Bold values indicate that the null hypothesis is rejected at the \(\alpha=0.05\) significance level for both tests. \begin{table}
\begin{tabular}{c c c c c c c c c c c c c} \hline \hline
**1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** & **9** & **10** & **11** & **12** & **13** \\ \hline
1 & - & **0.0011** & **0.0000** & **0.0108** & 0.3038 & 0.0706 & **0.0000** & **0.0108** & **0.0003** & **0.0108**In order to provide a simple visualization of the data organization, a Principal Component Analysis (PCA) was calculated at different stages of the methodology. Two examples of the data distribution of each class are depicted in Figures 17 and 18, corresponding to the folds with the best and worst performance on the testing data. The left scatter plots show the first two principal components from PCA calculated over the raw signals. The middle plots correspond to the data after the CSP (matrix \(\mathbf{Z}\)) calculation. Note a slightly different distribution between both folds because the CSP is performed with different training data. The plots on the right depict the data distribution after a randomly chosen run of the \({}^{+}\)FEGP algorithm. The classification accuracy for Figure 17 is 82.8% for training and 99.1% for testing. The homologous values for Figure 18 are 81.4% (training) and 44.1% (testing). Figure 16: Linear Discriminant Analysis (LDA) classification accuracy for the evolution of fitness. The accuracy plots show the history of LDA accuracy calculated over the best individual per fold; this represents the median over 30 independent runs. The fitness plot shows the evolution of fitness from the best individual representing the mean of the 13 (folds) medians over 30 runs by (**a**) using training data and (**b**) using testing data. Figure 15: Box plots of the enhanced system performance for 30 runs per fold, where (**a**) corresponds to the classification accuracy for the training partition and (**b**) is homologous for the testing partition.