Explainable XGBoost Models for Predicting Generalized Anxiety Disorder from Digital Mental Health Indicators
Keywords:
Generalized anxiety disorder, XGBoost, explainable artificial intelligence, SHAP, digital mental health, digital phenotyping, smartphone useAbstract
Objective: This study aimed to develop and evaluate an explainable XGBoost model for predicting generalized anxiety disorder from psychological, behavioral, and digital mental health indicators among Canadian adults.
Methods and Materials: This cross-sectional predictive study was conducted with 2,412 adults from Canada. Data were collected using standardized measures of generalized anxiety, psychological distress, depressive symptoms, sleep quality, smartphone addiction, and social media addiction, along with a structured digital lifestyle questionnaire assessing daily screen time, sleep duration, physical activity, technology-related stress, digital notification frequency, remote work hours, online gaming, and demographic characteristics. Generalized anxiety disorder risk was classified using the GAD-7 clinical cut-off. After preprocessing, missing-data imputation, feature encoding, and feature engineering, the dataset was divided into stratified training and testing subsets. An XGBoost classification model was optimized through cross-validation, and model explainability was examined using SHapley Additive exPlanations.
Findings: Generalized anxiety symptoms were strongly correlated with psychological distress (r = .79, p < .01) and depressive symptoms (r = .74, p < .01), and moderately to strongly correlated with poor sleep quality (r = .61, p < .01), smartphone addiction (r = .54, p < .01), and social media addiction (r = .46, p < .01). The optimized XGBoost model showed excellent predictive performance on the independent test set, with accuracy of 91.8%, precision of 89.6%, recall of 88.2%, specificity of 93.5%, F1-score of 88.9%, ROC-AUC of .957, PR-AUC of .944, balanced accuracy of 90.9%, Matthews correlation coefficient of .819, and Brier score of .081. SHAP analysis identified psychological distress, depression, sleep quality, smartphone addiction, previous mental health diagnosis, screen time, social media addiction, and technology-related stress as the most influential predictors.
Conclusion: Explainable XGBoost modeling demonstrated high accuracy and interpretability for predicting generalized anxiety disorder from digital mental health indicators, supporting its potential use in early screening, risk stratification, and personalized digital mental health assessment.
Downloads
References
Ahn, J. S., Jeong, I., Park, S., Lee, J., Jeon, M.-J., Lee, S., Do, G., Jung, D., & Park, J. Y. (2025). App-Based Ecological Momentary Assessment of Problematic Smartphone Use During Examination Weeks in University Students: 6-Week Observational Study. Journal of medical Internet research, 27, e69320. https://doi.org/10.2196/69320
Breitinger, S., Gardea‐Resendez, M., Langholm, C., Xiong, A., Laivell, J., Stoppel, C., Harper, L., Volety, R., Walker, A. J., D’Mello, R., Byun, A. J. S., Zandi, P. P., Goes, F. S., Frye, M. A., & Torous, J. (2023). Digital Phenotyping for Mood Disorders: Methodology-Oriented Pilot Feasibility Study. Journal of medical Internet research, 25, e47006. https://doi.org/10.2196/47006
Bufano, P., Laurino, M., Said, S., Tognetti, A., & Menicucci, D. (2023). Digital Phenotyping for Monitoring Mental Disorders: Systematic Review (Preprint). https://doi.org/10.2196/preprints.46778
Byun, A., Lane, E., Langholm, C., Flathers, M., Hall, M. H., & Torous, J. (2024). Towards Clinical Subtypes in Schizophrenia: Integrating Cognitive, Functional, and Digital Phenotyping Assessments. https://doi.org/10.21203/rs.3.rs-4258332/v1
Byun, A. J. S., Li, Y., Cong, S., Dhima, A., Wang, S., Flathers, M., & Torous, J. (2025). Sleep Estimation From Low Frequency Smartphone Sensors via Bayesian Hidden Markov Model. https://doi.org/10.21203/rs.3.rs-7217304/v1
Calvert, E., Dwyer, B., Lisowski, V., Mikkelson, J., Chen, K., Flathers, M., Hau, C., Xia, W., Martínez, J. A. C., Dhima, A., Ryan, S., & Torous, J. (2025). Social Media Detox and Youth Mental Health. JAMA Network Open, 8(11), e2545245. https://doi.org/10.1001/jamanetworkopen.2025.45245
Choudhary, S., & Srinivasan, G. (2022). The Importance of Using Binary Classification Models in Predicting Depression From a Machine Learning Perspective. Digital Medicine and Healthcare Technology, 2022, 1-4. https://doi.org/10.5772/dmht.12
Frank, A. C., Li, R., Peterson, B. S., & Narayanan, S. (2023). Wearable and Mobile Technologies for the Evaluation and Treatment of Obsessive-Compulsive Disorder: Scoping Review (Preprint). https://doi.org/10.2196/preprints.45572
Fulford, D., & Jacobson, N. C. (2025). Passive Sensing of Behavioral Markers of Psychopathology: Introduction to the Special Issue. Journal of Psychopathology and Clinical Science, 134(8), 855-859. https://doi.org/10.1037/abn0001035
Garzón‐Partida, A. P., Padilla-Gómez, C. B., Fernández, D., Garcı́a‐Estrada, J. n., Luquı́n, S., & Fernández-Quezada, D. (2025). The Implementation of Digital Biomarkers in the Diagnosis, Treatment and Monitoring of Mood Disorders: A Narrative Review. Frontiers in Digital Health, 7. https://doi.org/10.3389/fdgth.2025.1595243
Hammelrath, L., Brose, A., Heinrich, M., Zagorscak, P., Burchert, S., Langhammer, T., & Knaevelsrud, C. (2025a). PREACT-digital: Study Protocol for a Longitudinal, Observational Multi-Center Study on Wearable- And EMA- Based Predictors of Non-Response to CBT for Internalizing Disorders. https://doi.org/10.1101/2025.03.14.25323957
Hammelrath, L., Brose, A., Heinrich, M., Zagorscak, P., Burchert, S., Langhammer, T., & Knaevelsrud, C. (2025b). PREACT-digital: Study Protocol for a Longitudinal, Observational Multicentre Study on Digital Phenotypes of Non-Response to Cognitive Behavioural Therapy for Internalising Disorders. BMJ open, 15(7), e102392. https://doi.org/10.1136/bmjopen-2025-102392
Hassan, L., Milton, A., Sawyer, C., Casson, A. J., Torous, J., Davies, A., Ruiz‐Yu, B., & Firth, J. (2025). Utility of Consumer-Grade Wearable Devices for Inferring Physical and Mental Health Outcomes in Severe Mental Illness: Systematic Review. Jmir Mental Health, 12, e65143. https://doi.org/10.2196/65143
Jenciūtė, G., Kasputytė, G., Bunevičienė, I., Korobeinikova, E., Vaitiekus, D., Inčiūra, A., Jaruševičius, L., Bunevičius, R., Krikštolaitis, R., Krilavičius, T., Juozaitytė, E., & Bunevičius, A. (2023). Digital Phenotyping for Monitoring and Disease Trajectory Prediction of Patients With Cancer: Protocol for a Prospective Observational Cohort Study. Jmir Research Protocols, 12, e49096. https://doi.org/10.2196/49096
Jo, S. J., Lee, H. K., Kwon, S. J., Kim, Y., Kwak, J. S., & Lee, h. (2025). Unintended Positive Behavioral Changes During Self-Report and Wearable Data Collection On digital Media Use in Young Adults. Journal of Behavioral Addictions, 14(4), 1619-1624. https://doi.org/10.1556/2006.2025.00082
Kim, H., Kwon, S., Park, S., Kang, C., & Kim, H. (2025). Feasibility and Adherence to Ecological Momentary Assessment Among Community-Dwelling Adults With Suicide Risk. BMC Nursing, 24(1). https://doi.org/10.1186/s12912-025-03432-y
Lee, Y.-R., & Lee, J.-S. (2025). Real-Time Monitoring to Predict Depressive Symptoms: Study Protocol. Frontiers in Psychiatry, 15. https://doi.org/10.3389/fpsyt.2024.1465933
Linardon, J., & Torous, J. (2025). Integrating Artificial Intelligence and Smartphone Technology to Enhance Personalized Assessment and Treatment for Eating Disorders. International Journal of Eating Disorders, 58(8), 1415-1424. https://doi.org/10.1002/eat.24468
Maatoug, R., Oudin, A., Adrien, V., Saudreau, B., Bonnot, O., Millet, B., Ferreri, F., Mouchabac, S., & Bourla, A. (2022). Digital Phenotype of Mood Disorders: A Conceptual and Critical Review. Frontiers in Psychiatry, 13. https://doi.org/10.3389/fpsyt.2022.895860
Mansoubi, M., Dawes, J., Bhatia, A., Vashisht, H., Collett, J., Greenwood, D. C., Ezekiel, L., O’Connor, D. B., Leveridge, P., Rayner, C., Read, F., Sivan, M., Tucker-Bell, I., Ward, T., Delaney, B., Muhlhausen, W., & Dawes, H. (2023). Digital Home Monitoring for Capturing Daily Fluctuation of Symptoms; A Longitudinal Repeated Measures Study: Long Covid Multi-Disciplinary Consortium to Optimise Treatments and Services Across the NHS (A LOCOMOTION Study). BMJ open, 13(8), e071428. https://doi.org/10.1136/bmjopen-2022-071428
Marciano, L., Vocaj, E., Bekalu, M. A., Tona, A. L., Rocchi, G., & Viswanath, K. (2023a). The Use of Mobile Assessments for Monitoring Mental Health in Youth: Umbrella Review. Journal of medical Internet research, 25, e45540. https://doi.org/10.2196/45540
Marciano, L., Vocaj, E., Bekalu, M. A., Tona, A. L., Rocchi, G., & Viswanath, K. (2023b). The Use of Mobile Assessments for Monitoring Mental Health in Youth: Umbrella Review (Preprint). https://doi.org/10.2196/preprints.45540
Mendes, J. P. M., Moura, I. R. d., Ven, P. V. d., Viana, D., Silva, F., Coutinho, L., Teixeira, S., Joel, J. P. C. R., & Teles, A. S. (2022). Sensing Apps and Public Data Sets for Digital Phenotyping of Mental Health: Systematic Review. Journal of medical Internet research, 24(2), e28735. https://doi.org/10.2196/28735
Moukaddam, N., Sano, A., Salas, R., Hammal, Z., & Sabharwal, A. (2022). Turning Data Into Better Mental Health: Past, Present, and Future. Frontiers in Digital Health, 4. https://doi.org/10.3389/fdgth.2022.916810
Shin, Y., Kim, A. Y., Kim, S., Shin, M. S., Lee, K. L., Lee, J. S., Byun, S., Kim, S., & Cho, C. H. (2025). Development of Prediction Models for Screening Depression and Anxiety Using Smartphone and Wearable-Based Digital Phenotyping: Protocol for the Smartphone and Wearable Assessment for Real-Time Screening of Depression and Anxiety (SWARTS-DA) Observational Study in Korea. BMJ open, 15(6), e096773. https://doi.org/10.1136/bmjopen-2024-096773
Wang, P., Liu, H., Shi, Y., Liu, A., Zhu, Q., Albu, I., Pacholec, M., Cheng, L., Sun, X., & Chi, X. (2025). Harnessing Small‐Data Machine Learning for Transformative Mental Health Forecasting: Towards Precision Psychiatry With Personalised Digital Phenotyping. Med Research, 1(2), 226-238. https://doi.org/10.1002/mdr2.70017
Winbush, A., McDuff, D., Nelson, B., Heneghan, C., Hernandez, J., & Allen, N. B. (2026). Smartphone-Derived Biobehavioral Rhythms and Their Associations With Depression, Anxiety, and Sleep Disturbance. https://doi.org/10.21203/rs.3.rs-9633601/v1
Wright, L. A., Bakštein, E., Saunders, K., Guo, B., & Morriss, R. (2026). Performance of Active and Passive Ambulatory Assessment Measures and Mood Monitoring in Bipolar Disorder: A Systematic Review. International Journal of Bipolar Disorders, 14(1). https://doi.org/10.1186/s40345-025-00407-5
Zainal, N. H., Rajendra, S. J., Doren, N. V., Salamanca-Sanabria, A., Curtiss, J., & Keng, S. L. (2025). Digital Positive Affect Intervention (PAI) Versus Self-Monitoring Placebo in the Treatment of Anxiety and Depression: A Two-Arm Randomized Controlled Trial (RCT). BMC psychiatry, 25(1). https://doi.org/10.1186/s12888-025-07372-4
Zarate, D., Stavropoulos, V., Ball, M. B., Collier, G. d. S., & Jacobson, N. C. (2022). Exploring the Digital Footprint of Depression: A PRISMA Systematic Literature Review of the Empirical Evidence. https://doi.org/10.31234/osf.io/tqvfk
Zarski, A. C., Sextl-Plötz, T., Schmidt-Hantke, J., Hess, N. S., & Buntrock, C. (2025). Participatory Development and Proof-of-Concept of a Dyadic-Based, AI-driven, Just-in-Time Adaptive Intervention Mechanism for Preventing Anxiety and Depressive Disorders via App: Study Protocol for a Feasibility Study. Frontiers in Public Health, 13. https://doi.org/10.3389/fpubh.2025.1626428

