# Hybrid Deep Learning Approach for Automated Sleep Cycle Analysis
## 4 Results and Discussion
### Model Evaluation
These results reveal varying performance across different classes, with N1 being the most difficult to classify and N3 performing the best. The poor performance of N1 in several metrics can be attributed to its underrepresentation in the data, a common challenge in unbalanced classification problems. In contrast, classes N2, N3, R, and W showed consistent and balanced performance. These differences underscore the importance of addressing class imbalance to improve the accuracy and balance in predictions. After calculating the metrics for each class, macro-average metrics were derived, and [PERSON]'s kappa coefficient was calculated for the test set matrix, yielding a value of 73.39%, confirming the model's consistency and the validity of its predictions. The results of the overall test metrics are presented in Table 6. In the following, a comparative analysis between the test results and validation results is provided. * Overall accuracy: The accuracy on the test set was 78.67%, indicating relatively accurate classification in general. This result is satisfactory, especially given the significant class imbalance in this multiclass classification problem. The close match with the accuracy of 78.21% in the validation set suggests good consistency between model training and generalization to new data. * Precision: The precision of 74.35% indicates an acceptable rate of correct predictions for the positive class. However, compared to the precision of 79.20% on the validation set, it can be inferred that the underrepresentation of class N1 limited the performance in the test set. * Recall: The recall of 73.73% indicates that the model successfully classified most of the positive samples. This is consistent with the recall of 78.21% from the validation set, indicating that the model's capacity to identify positive classes showed minimal variation between the two sets. \begin{table}
\begin{tabular}{c c} \hline \hline
**Metric** & **Value** \\ \hline Overall Accuracy & 78.67\% \\ \hline Precision & 74.35\% \\ \hline Recall & 73.73\% \\ \hline F1-Score & 72.10\% \\ \hline Specificity & 94.77\% \\ \hline NPV & 94.41\% \\ \hline Jaccard & 60.73\% \\ \hline Cohen’s Kappa & 73.39\% \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Classification results of the best model on the test set. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Metric \%**} \\ \hline
**Class** & **Precision** & **Recall** & **F1-Score** & **Specificity** & **NPV** & **Jaccard** \\ \hline N1 & 17.40 & 49.11 & 25.70 & 88.06 & 97.12 & 14.74 \\ \hline N2 & 87.54 & 85.35 & 86.43 & 92.10 & 90.62 & 76.10 \\ \hline N3 & 86.61 & 89.30 & 87.93 & 97.89 & 98.36 & 78.46 \\ \hline R & 82.63 & 70.90 & 76.32 & 96.36 & 93.14 & 61.70 \\ \hline W & 97.56 & 73.97 & 84.14 & 99.45 & 92.81 & 72.63 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Per-class test performance metrics. F1-Score: The F1-score of 72.10% indicates a reasonable equilibrium between the precision and recall metrics. The drop in the F1-score from the validation set, where it was 78.43%, is mainly due to the significant decrease in precision for class N1 in the test set. * Specificity: The specificity of 94.77% suggests excellent performance in identifying negative samples, consistent with the specificity of 94.55% from the validation set, reflecting a low false negative rate. * NPV: The NPV of 94.41% indicates the effectiveness of the model in accurately identifying negative classes, corroborated by the NPV of 94.55% observed in the validation set. * Jaccard Index: The Jaccard index of 60.73% indicates acceptable similarity between the model outputs and the actual labels, although there is room for improvement compared to the Jaccard index on the validation set of 66.12%. The difference is mainly due to the class imbalance for N1. * Cohen's Kappa: Finally, the Cohen's Kappa score of 73.39% indicates a high degree of consistency between the predictions and the true labels, which implies that the model's decisions are not coincidental.