## 7 Conclusions  
The machine learning model developed in this study demonstrates promising performance in detecting apnea events, with a recall rate of 76% on the test set, indicating high sensitivity in identifying potential apnea episodes. This makes the model a valuable diagnostic tool that helps clinicians identify events requiring further analysis. Although the model tends to detect more apnea events than actually occur (resulting in false positives), this is considered beneficial in a clinical context, since false negatives (missed apnea episodes) pose significant health risks. By reducing the number of false negatives, the model ensures that patients with potential apnea are flagged for additional monitoring or intervention. The integration of the developed model is envisioned through a web application designed as a platform for healthcare professionals. This platform would provide doctors with an enhanced diagnostic tool, enabling more accurate and reliable disease detection by analyzing input signals using the generated model. The framework, based on LSTM analysis of polysomnography (PSG) and oximetry data, enhances personalized apnea detection. The LSTM network design, which includes a bidirectional layer with dropout functionality, effectively captures complex temporal patterns, achieving an overall balanced accuracy of 79%, precision of 68%, and recall of 76%on the test set. These results surpass traditional diagnostic methods, offering a balanced approach between recall and specificity. The model utilizes Long Short-Term Memory (LSTM) networks in combination with dense layers, optimized through hyperparameter tuning using the Weights and Biases (WandB) tool to address the imbalance between apneic and non-apneic events. While the model achieved promising results, it faced challenges related to false positives with confusion matrices showing a trade-off between recall and loss. Priority was given to recall, as the accurate detection of apneic events is critical in the clinical context. Regarding interpretation, feature engineering played a crucial role in optimizing model performance. By extracting key statistical features such as standard deviation, amplitude, and gradient and applying a sliding window approach for sequence generation, the model's sensitivity to apnea events was significantly improved. Visualizations such as parallel coordinates plots helped assess the impact of hyperparameters, while configuration management using the Hydra tool enabled systematic experimentation and the efficient handling of complex models. Hyperparameter optimization, which explored over 500,000 combinations, further refined the model to prevent overfitting and ensure robust performance on diverse patient data. This framework has the potential to transform clinical practice by enabling early detection, personalized treatment planning, and improved management of patients with OSA. Future improvements will focus on further fine-tuning model parameters, reducing false positives, improving feature extraction, and incorporating real-time data from wearable devices and patient demographics to further enhance accuracy. With continued development, this machine learning approach promises significant advancements in the diagnosis and management of OSA, supporting more effective and data-driven solutions in sleep medicine. Conceptualization, K.Z. and Y.S. ; methodology, Y.S. and K.Z. ; software, Y.S. and K.Z. ; validation, P.S., T.P., I.P.D., R.P. and Z.D. ; formal analysis, Y.S. ; investigation, K.Z. and K.Z. ; resources, I.P.D., R.P., P.S. and Z.D. ; data curation, K.Z. and Y.S. ; writing--original draft preparation, K.Z., Y.S., T.P. and P.S. ; writing--review and editing, K.Z., Y.S., T.P. and P.S. ; visualization, K.Z. and Y.S. ; supervision, P.S., T.P., I.P.D., R.P. and Z.D. ; project administration, P.S., T.P., I.P.D., R.P. and Z.D. All authors have read and agreed to the published version of the manuscript. This research received no external funding.