## 4 Discussion  
### Signal Classification  
According to our experience and expectations, most of the patients were sufficiently relaxed in the 14 th minute. The best results of the classifier at this time confirmed our expectations, to some extent. To examine the hypotheses about the substantial increase in alpha power and decrease in beta (to some extent) power in the estimated phase of deepest relaxation, we carried out the two one-way ANOVAs comparing the individual scores in brainwaves between group conditions (guided imagery or mental task) during the time phase of 14 min. We found predicted, significant effect of group (F (1, 53) = 4.01, \(p\) = 0.05, \(\mathrm{p}\) = 0.070), indicating that the alpha power in the guided imagery group (M = 0.24, SD = 0.14) was significantly higher than that in the mental task group (M = 0.17, SD = 0.12). However, we found no significant effect of group for beta power scores (F (1, 53) = 0.53, \(p\) = 0.47, \(\mathrm{p}\) = 0.010), and beta power in the guided imagery group (M = 0.08, SD = 0.03) was very similar to that in the mental task group (M = 0.07, SD = 0.03). However, only the best signal (with less than 10% excluded epochs) was considered. Table 1 presents the GLM results obtained for both the training set and validation set, and the values of the obtained parameters confirmed the classifier's high level of stability in the considered time range.  
As an accuracy of 68% was achieved by the classifier when using a 3 s time interval, we wondered if inputting more signal would increase the efficiency. The answer to this was yes, and in Table 2, the results with respect to classifier efficiency for 1-min-long intervals of time are shown. After 13 min, the efficiency of the GLM increased to 78%, which is a satisfactory result, especially because, in this case, we took all the signals recorded instead of the best ones. Notably, poor epochs were interpolated by the software and used for analysis, as described in the Methods section. Similarly, Table 2 presents the GLM results obtained on both the training and validation sets, and the values of the obtained parameters indicate the classifier's high level of stability in the discussed time range.  
Table 3 presents the results obtained for the GLM classifier for all collected signals in the whole 20-min-long time range. An accuracy of approximately 92% with a similar F1 score proved its high efficiency for the whole collection of data, both on the training and validation sets. Th ROC curve presented in Figure 4 confirms its stability.  
The software libraries discussed in the Methods section provided us with overtraining and data leakage incidents.  
Figure 5: Power activity in the \(\delta\), \(\theta\), \(\alpha\), and \(\beta\) bands for participant s299392 exposed to guided imagery.  
Figure 6: Power activity in the \(\delta\), \(\theta\), \(\alpha\), and \(\beta\) bands for participant s303840 exposed to the mental task.  
The aim of this study was to check whether machine learning can be used to classify the state of the participant's brain and distinguish engaging in deep GI relaxation from performing a mental task. The results presented herein confirm this possibility.  
The other conclusion that can be derived from this study is that the more signal (or the longer signal) the classifier obtains, the higher the accuracy.