# Efficient Sleep-Wake Cycle Staging via Phase-Amplitude Coupling Pattern Classification
## 4 Discussion
This suggests that, although the PAC between such frequency pairs does have a profound relationship with SWC oscillatory phenomena, they do not describe it completely, being more important to the REM stage, specifically. Conversely, the values of the PAC synchronization across other frequency pairs seem to be needed for optimal classification. Curiously, the usage of just the first half of the comodulogram yielded significantly better classification than the usage of the whole comodulogram, although only slightly. In our understanding, this is a compelling result in support of smart choices of input datasets and that brute force options are not always the solution. Not only do bigger datasets imply computationally heavier models, but they do not necessarily yield improved performance. Indirectly, this also supports the concept of \"garbage in, garbage out\" in signal processing and machine learning, which can be translated here as no matter how powerful one's network is, no good classification will be attained if the data are poor in their relevance to the brain process under investigation. In the same vein, the present findings showed that the number of neurons in the hidden layer must be chosen with care in these applications. While simpler input protocols performed better with the maximum number, this was not the case for the more complex choices. Not only was the average performance lower with the maximum values but also performance was unstable as shown by the high variability across distinct runs in this extremity. The same happened in the lower extremity. In fact, for these protocols, there seems to be a narrower middle range in which the model is stable. Importantly, such range also yields the highest AUC values. For protocol 3, the range is between 15 and 60 neurons, and for protocol 4, it is between 6 and 70 neurons. Curiously, REM seems to be the most susceptible stage, showing greater variations in the extremities and the narrowest range of stable AUC values (in comparison with SWS for instance). The reasons for this behavior are unclear but may be related to the fact that REM is the class with the smaller number of samples in the dataset. Overall, the results from phase 2 showed that, by using protocol 4 with 15 neurons in the hidden layer, experimenters can train the network on a small subset of the data to confidently classify the rest of it. In fact, all the extrapolation strategies tested here with this architecture, which are relatable to applications in the lab setting, typically yielded good performances that did not vary substantially in any of the dimensions tested, either across the days of experiments (Figures 4, 5 and 7) nor the different animals (Figure 6). As expected, the values of all the metrics dropped as less of the original dataset was used for training the network (Figure 8 and Tables 3-5). Yet, even in the worst-case scenario, in which the network is trained on data from a single day of the worst predicting animal, the average performance is still an over 0.95 AUC value. On the other hand, the F1-scores in both cases (best and worst animals) of strategy 4 were not as high, around 0.77 (Table 5). Interestingly, the results suggest that the generalizability of the training from a single animal and single day can be impaired in different ways, in which the precision or recall can be lower (see Tables 3 and 4). Of course, the acceptable level and type of error must be previously defined by potential users, so one can properly choose the strategy to be adopted. Naturally, if very high overall performance is required, initial labor-intensive work of annotating larger portions of the data by expert inspection will be needed, impairing automation aspects. Even more, it is recommendable that the approach is validated once again on an initial annotated dataset for each new application, including searching for the optimal architecture (steps of phase 1). This will certainly maximize the performance metrics.