## 3 Results and Discussion
Each sub-figure shows the precision-recall curves for all algorithms (different colours). The obtained results provided the following insights. First, the lowest areas under the precision-recall curves were achieved at 30 Hz mean (Figure 3B). This indicates that the overall power may not be a reliable marker of a seizure. In particular, the precision is low, indicating a large number of false detections. The possible explanation is that there are many events characterized by an increase in overall power, such as artefacts or sleep-related patterns [42]. Second, using 3 Hz mean improves the precision-recall curves (Figure 3A). This illustrates that seizures produce an outlier in a specific frequency band rather than increasing the overall power. In line with our previous results, this confirms that extreme behaviour occurs in a certain frequency range [24,33]. Third, the mean spectral power provides the worst results for the LOF and LNND algorithms (red and green curves). Moreover, the transition to the specific frequency band of 3 Hz barely improves the performance of these methods. We see that the green and red curves practically do not change between Figure 3A,B, while the others show higher precision. Note that LOF and LNND are distance-based methods, working similarly to kNN but using a different distance measure. Knowing that kNN improves performance when switching from 30 Hz mean to 3 Hz mean, we hypothesize that the distance measure affects the separability between the classes. Fourth, using the entire 30 Hz range provides the widest feature space in which we see that the LOF and LNND perform better. The possible reason for this is that the  
Figure 3: Precision–recall curves for the different outlier detection algorithms are shown in different colours. Each panel reflects the type of input data as stated in the panel caption: **(A)** 3 Hz mean; **(B)** 30 Hz mean; **(C)** 3 Hz raw; **(D)** 30 Hz raw; **(E)** 3 Hz PCA; **(F)** 30 Hz PCA. boundary between the classes changes its configuration in the different feature spaces. Fifth, the best precision-recall curve is achieved using the LNND trained on 30 Hz PCA (Figure 3F). Interestingly, the LNND improves its performance when using PCAs in the 30 Hz range rather than 3 Hz. An intuitively clear explanation is that extending the frequency range provides more distinguishing features together with an increasing amount of unnecessary information and correlated features, therefore limiting the ability to improve. Using PCAs reduces the amount of unnecessary information and rejects correlations between features but leaves the advantage of using a wide frequency range. Finally, we analysed the effect of the distance measure in the distance-based algorithms on the separability between seizures and normal activity in the feature space. We introduced distance between the classes, a normalized difference between the median distances to seizures and normal states, and tested if it was dependent on the algorithm, frequency band, or feature (see Figure 4). The median distances did not follow a normal distribution in the group of patients (according to the Shapiro-Wilk test), having long tails over the high values. Therefore, we removed 5% of patients with the highest values and transformed the rest data using the root-mean-square. Resulting values underwent repeated measures of analysis of variances (rm ANOVA) with two within-subject factors: frequency band (3 Hz and 30 Hz) and feature (raw, mean, PCA) separately for three ML algorithms (LNND, kNN, and LOF). For the LNND, the rm ANOVA reveals a significant main effect of the feature: F(2,106) = 11.468, \(p\) < 0.001. The main effect of the frequency band was insignificant: F(1,53) = 1.472, \(p\) = 0.23. Finally, the interaction effect feature \(\times\) frequency band was also insignificant: F(2,106) = 1.365, \(p\) < 0.26. These results evidence that the distance between the classes depends on the feature in a similar way for both frequency bands. The direction of change is shown in Figure 4A.