## 3 Results  
This section presents and compares the results of training different machine learning algorithms in three different fashions. Before presenting the results of the different test batteries in detail, a preliminary exploratory analysis of the data is presented to gain useful insights into the EEG data distribution after their preprocessing and epoching. The experimental EEG raw data are available from 75 patients with PNES, 75 healthy patients (CNT), and 75 epileptic patients (EPI). However, 10 EEGs (1 CNT, 3 PNES, 6 EPI) showed the presence of an amplifier in saturation stage on at least one channel for the entire duration of the EEG recording and were excluded from further analyses. As shown in the pie chart in Figure 5a, the exclusion criteria did not produce an imbalance between the classes. Since the 225 input EEG data do not have the same duration, and the routine that eliminates EEG portions where the amplifier is in a saturation stage further reduces the duration of some EEG recordings, the segmentation process does not produce the same  
Figure 4: EEG signals power in the beta band evaluated for all epochs. number of epochs for each EEG. Therefore, we also verified that the dataset continued to be balanced even after segmenting the signal into epochs, as shown in the pie chart in Figure 5b. The violin plots in Figure 6 allow to visually compare the distributions of the EEGs epochs obtained for each class. To formally compare the epochs distribution obtained by class, we first check the three distributions are not normally distributed through the Shapiro-Wilk's test and a significance level \(\alpha=0.05\) with \(p<0.001\) for the EPI group, \(p<0.001\) for the PNES group, and \(p<0.001\) for the CNT group. Then, a Kruskal-Wallis test showed that there was no statistically significant difference in segmented epochs among the three groups, \(\chi^{2}(X)=1.17\), \(p=0.56\), \(\alpha=0.05\). The different test batteries described in Section 2 were conducted through the Python PyCaret library. To be able to evaluate how much the segmentation of the EEG recordings in epochs affects the performance, three different approaches were considered. In particular:  
Figure 5: Class distribution (**a**) after preprocessing (**b**) after segmentation. Due to the different duration of the EEGs recordings, the segmentation process does not produce the same number of epochs for each EEG. However, the comparison of the two pie charts shows that the dataset of segmented EEGs epochs does not presents any significant imbalance among classes. Figure 6: Violin plot of the EEGs epochs distributions by class. Although the PNES class shows an high outlier and the CNT and EPI classes show low outliers, the three distributions are unimodal and show similar median and interquartile range. * We extracted features as described in Section 2 from the 215 EEG recordings, without EEG epoching, and evaluate the classifiers by a standard 10-fold cross validation. * We performed EEG epoching and feature extraction as described in Section 2, then different models built on the 22,261 EEG epochs dataset were evaluated by a patient-aware 10-fold cross validation strategy. Specifically, the 215 patients were randomly divided into 10 sets and all the 10 s epochs extracted from the same EEG recording were constrained to belong to the same fold. Therefore, at every run, the features of the EEG epochs segmented from the same EEG recording, appear either in the training or in the test set. * We performed EEG epoching and feature extraction as described in Section 2, then different models built on the 22,261 EEG epochs dataset were evaluated by a standard 10-fold cross validation strategy. Each EEG epoch was considered independent from the others and therefore, while ensuring that the 10-folds were disjointed, we allowed that different EEG epochs segmented from of the same EEG recording could appear in different folds.