# Efficient Sleep-Wake Cycle Staging via Phase-Amplitude Coupling Pattern Classification
## 3 Results
### Top Performing Network of Protocol 4 Extrapolates Well across Animals and/or Days of Experiment  
For the second phase of experiments, we chose the architecture using protocol 4 (first (left) half of the comodulogram; 1-10 Hz) for the input dataset with 15 neurons in the hidden layer, as it was the best performing one. The results obtained for the four extrapolation strategies are depicted in Figures 4-8, in the same sequence as shown in Figure 1D. In every case, the performance of the chosen architecture across all the testing scenarios was always above 0.9. In the first extrapolation strategy, with a random division of 70%/30% train and test data, the AUC values were always above 0.95, with REM showing the highest values, and without noticeable variation across the different days (Figure 4). The global accuracy in this first assessment was 0.924 (Table 2). The same goes for extrapolating the training of one day (day 1), all animals, to classify the other days: the AUC remained high (>0.95) with a slight decrease as the days passed (Figure 5). The global accuracy here was 0.920 (Table 2). The AUC values are also high when there is an extrapolation from one animal (animal 1), all days, to the others (Figure 6). Although the variability in the results is higher, the average AUC values were always higher than 0.94. The global accuracy was 0.898 (Table 2). Even in the most demanding scenario, in which the network trained on a single day of a single animal is used to classify the rest of the dataset, the AUC values remained over 0.9 and without noticeable variation across the days (Figure 7), particularly for the case of REM. This applies to the extrapolations using both the best and worst animal in the dataset. The accuracies in strategy 4 were 0.879 and 0.864 for the best and worst cases, respectively (Table 2). When all the strategies are compared against each other, it becomes clear that the performance decreases from the least (strategy 1) to the most demanding scenario (strategy 4) in a statistically significant way (Figure 8). Moreover, in strategy 4, the extrapolation using the worst animal (10; lowest prediction average in panel A) performs statistically worse than using the best one (7; highest prediction average in panel A). Here, again, the REM stage seems to be the least affected by the strategy choice. Finally, Tables 3-5 below show, respectively, the results for the precision, recall, and F1-score for all the extrapolation strategies. Overall, all these metrics were also high, typically over 0.9 for SWS or 0.8 for WK, while REM shows both high and a couple of moderate values in the most demanding scenarios. The global average of all the values is 0.88. The confusion matrices and the complete set of its derived metrics for all the strategies can be found in Figures S1-S5 and Tables S1-S5 of the Supplementary Materials. Graph versions of Tables 3-5 can be found in Figures S6-S8 of the Supplementary Materials. Figure 4: Extrapolation strategy 1. Training data on 70% of all the data to test on the remaining 30% resulted in high AUC values (average always >0.95) of all the animals, all days, with small variability (<5%) for all the stages: (**A**) WK; (**B**) SWS; (**C**) REM, and (**D**) ALL. The top row depicts each AUC value for each animal and each day as color-coded panels (see the lateral bar for scale). The bottom row shows the average of all the animals for each of the five days of the dataset with the variability (s.e.m.) being depicted in the background shadow of the same color in a lighter hue. The classification of the REM stage was shown to be particularly optimal considering both the high AUC values and low variability. Figure 5: Extrapolation strategy 2. Training with the first day of all the animals also resulted in high AUC values (>0.95) for the classification of stages in the other days, with small variability: (**A**) WK; (**B**) SWS; (**C**) REM, and (**D**) ALL. There is a slight decrease in the values as the days pass.