Abstract
INTRODUCTION: Depressive symptoms commonly co-occur with obstructive sleep apnea (OSA), increase disease burden, and may precede major depressive disorder (MDD). In routine sleep-clinic practice, mood symptoms can be overlooked during the work-up for suspected OSA and at the time of polysomnography (PSG)-confirmed diagnosis, because consultations focus primarily on sleep-breathing and cardiometabolic complaints. Guided by the biopsychosocial model, this multicenter study aimed to develop and validate an interpretable machine-learning (ML) model to predict the risk of depressive symptoms in patients with OSA. METHODS: This study included 634 adults with OSA from two sleep centers. Participants from the first center (n = 400) were randomly allocated to a training cohort and an internal validation cohort in a 7:3 ratio. An external validation cohort (n = 234) was recruited from the second center. Depressive symptoms were defined as a Patient Health Questionnaire‑9 (PHQ‑9) score ≥ 10. Candidate predictors covered biological, psychological, and social factors. Least absolute shrinkage and selection operator (LASSO) regression was used for feature selection. Eight ML algorithms were trained and tuned by 10‑fold cross‑validation. The best‑performing model was interpreted using SHapley Additive exPlanations (SHAP), and a web‑based prediction tool was constructed. RESULTS: In the external validation cohort, the random forest (RF) model showed the best overall performance, with an area under the receiver operating characteristic curve (AUC) of 0.815, accuracy of 0.833, and Brier score of 0.154. Decision‑curve analysis supported its clinical utility. SHAP analysis identified perceived stress level, apnea-hypopnea index (AHI), and hypertension as the most influential predictors, followed by OSA severity, sleep quality, total sleep time, mean oxygen saturation (MSaO(2)), body mass index (BMI), and sex. CONCLUSION: This study developed and externally validated an interpretable random forest-based model to predict the risk of depressive symptoms in patients with OSA. The model integrates key biopsychosocial features, shows good discrimination and calibration, and offers a favorable net benefit. The accompanying web‑based tool supports practical risk assessment and may facilitate early identification, risk stratification, and personalized intervention to help prevent progression to MDD.