## 3 Results
### Machine Learning Data Analysis  
The signal was classified using generalized linear models (GLMs) using the implementation included in the h2o library available for Python. Model tests based on different time windows were conducted in Python version 3.7.5.  
The quality of the classification was tested for the same time intervals in the two data groups.  
Group A: Signals with less than 10% erroneous epochs; Group B: all signals included in the dataset (60 signals). According to the documentation of the h2o library, using generalized linear models, balanced data were not required.  
In the case of Group B, the signals removed due in noisy epochs were interpolated by the library mentioned above.  
Figure 2: Power activity in the \(\delta\), \(\theta\), \(\alpha\), and \(\beta\) bands for participant s299392 exposed to guided imagery. Each row, one-by-one, represents a 3-min slot, for 21-min in total. For details, see the text.  
The training and validating sets were divided into proportions of 80% and 20%, respectively.  
Table 1 shows the results of the GLM classifier for Group A. The 3 s long time intervals were investigated around the 5 th, 10 th, 13 th, 14 th, and 15 th minutes. The choice of these probing times was arbitrary based on the experience of the GI relaxation therapist.  
The results of the GLM classifier for Group B are shown in Table 2, where a 60 s time interval was chosen because we suspected that the signals were of worse quality in this group. The probing was investigated around the 5 th, 10 th, 13 th, 14 th, and 15 th minutes and the following 1 min after each probe.  
Table 3 shows the results of the GLM classifier for Group B, and the whole 20-min signal recordings were classified without any signal probing.  
In Figure 4, the ROC curve for the GLM applied to Group B using the full-length 20-min signal recordings is presented. The set of statistical characteristics for this case are presented as follows: For the training set: MSE: 0.0634, RMSE: 0.2518, LogLoss: 0.2021,  
Figure 3: Power activity in the \(\delta\), \(\theta\), \(\alpha\), and \(\beta\) bands for participant s303840 exposed to mental task. Each row, one-by-one, represents a 3-min slot, for 21-min in total. For details, see the text.  
AUC: 0.9748, AUCPR: 0.9834; For validation set: MSE: 0.05227, RMSE: 0.2286, LogLoss: 0.1676, AUC: 0.9823, and AUCPR: 0.9877.  
Table 1 shows that the best results, with approximately 68% accuracy, were achieved near the 13 th and 14 th minutes using the GLM classifier. A 3 s time interval was sufficient for analyzing and estimating the state of the brain during the time in which it was recorded.  
Figures 5 and 6 show topographical maps of participants from Figures 2 and 3 for five frequency bands of the time window where the classifier was performing best.  
\begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Group** & **dT (s)** & \begin{tabular}{c} **ACC** \\ **Train** \\ \end{tabular} & **F1 Train** & \
\begin{tabular}{c} **AUC** \\ **Train** \\ \end{tabular} & **ACC** & **F1 Valid** &
\begin{tabular}{c} **AUC** \\ **Valid** \\ \end{tabular} \\ \hline A & 299–301 & 0.6559 & 0.7165 & 0.7255 & 0.6252 & 0.7027 & 0.6808 \\ \hline A & 599–601 & 0.6578 & 0.7156 & 0.