Predicting Major Depressive Disorder Using Random Forest Models Based on Psychological, Behavioral, and Lifestyle Indicators
Keywords:
Major Depressive Disorder, Random Forest, Machine Learning, Depression Prediction, Psychological Indicators, Lifestyle Behaviors, Sleep Quality, Mental Health ScreeningAbstract
Objective: This study aimed to develop and evaluate a Random Forest classification model for predicting Major Depressive Disorder among Canadian adults using integrated psychological, behavioral, and lifestyle indicators.
Methods and Materials: This cross-sectional predictive study was conducted among 1,742 adults residing in Canada. Participants completed standardized self-report instruments assessing depressive symptoms, anxiety, stress, emotion regulation difficulties, perceived stress, sleep quality, physical activity, and lifestyle behaviors. Major Depressive Disorder status was determined using the Patient Health Questionnaire-9 cut-off score for clinically significant depressive symptoms. Psychological indicators included DASS depression, anxiety, and stress scores, perceived stress, and emotion regulation difficulties. Behavioral and lifestyle variables included sleep quality, sleep duration, physical activity, screen time, body mass index, alcohol consumption, and demographic characteristics. Data preprocessing included missing-value management, categorical encoding, and feature preparation. The dataset was divided into training and testing subsets using stratified sampling. A Random Forest classification algorithm was trained and optimized through five-fold cross-validation and grid-search hyperparameter tuning. Model performance was evaluated using accuracy, sensitivity, specificity, precision, F1-score, balanced accuracy, ROC-AUC, Cohen’s Kappa, Matthews Correlation Coefficient, and feature-importance analysis.
Findings: The optimized Random Forest model demonstrated strong predictive performance on the independent test dataset, with accuracy of 91.38%, sensitivity of 89.12%, specificity of 92.31%, precision of 87.64%, F1-score of 88.37%, balanced accuracy of 90.72%, ROC-AUC of 0.957, Cohen’s Kappa of 0.804, and Matthews Correlation Coefficient of 0.806. Five-fold cross-validation confirmed model stability, with mean accuracy of 91.38%, mean precision of 87.89%, mean recall of 89.14%, mean F1-score of 88.51%, and mean ROC-AUC of 0.957. Feature-importance analysis identified DASS depression, perceived stress, emotion regulation difficulties, sleep quality, anxiety, stress, screen time, and physical activity as the strongest predictors.
Conclusion: The findings indicate that Random Forest modeling can accurately predict probable Major Depressive Disorder using psychological, behavioral, and lifestyle indicators. The model showed high discrimination, stable validation performance, and clinically interpretable predictor patterns, supporting its potential value as a scalable screening approach for identifying adults at elevated risk of depression.
Downloads
References
Akif, A., & Islam, M. R. (2026). The Microbiota‐Gut‐Brain Axis in the Pathophysiology of Major Depressive Disorder: A Mechanistic Review. Comprehensive Physiology, 16(1). https://doi.org/10.1002/cph4.70100
Atagün, M. İ. (2025). Longitudinal Trajectories of Major Depressive Disorder Provide Further Clinical Perspectives for Precision Psychiatry. Psychiatry and Clinical Neurosciences Reports, 4(4). https://doi.org/10.1002/pcn5.70221
Baalen, M. v., Velden, L. v. d., Gronde, T. v. d., & Pieters, T. (2025). Developing a Translational Research Framework for MDD: Combining Biomolecular Mechanisms With a Spiraling Risk Factor Model. Frontiers in Psychiatry, 15. https://doi.org/10.3389/fpsyt.2024.1463929
Berk, M., Köhler‐Forsberg, O., Turner, M., Penninx, B. W., Wrobel, A., Firth, J., Loughman, A., Reavley, N., McGrath, J. J., Momen, N. C., Plana‐Ripoll, O., O’Neil, A., Siskind, D., Williams, L. J., Carvalho, A. F., Schmaal, L., Walker, A. J., Dean, O., Walder, K., . . . Marx, W. (2023). Comorbidity Between Major Depressive Disorder and Physical Diseases: A Comprehensive Review of Epidemiology, Mechanisms and Management. World Psychiatry, 22(3), 366-387. https://doi.org/10.1002/wps.21110
Blumenthal, J. A., & Rozanski, A. (2023). Exercise as a Therapeutic Modality for the Prevention and Treatment of Depression. Progress in Cardiovascular Diseases, 77, 50-58. https://doi.org/10.1016/j.pcad.2023.02.008
Borrego-Ruiz, A., & Borrego, J. J. (2025). Biological, Psychosocial, and Microbial Determinants of Childhood-Onset Obsessive–Compulsive Disorder: A Narrative Review. Children, 12(8), 1063. https://doi.org/10.3390/children12081063
Cañizares, C., Gómez, Y., Ferro, E., Torres, C. A., Agudelo, D., & Odom, G. (2023). Using Tree-Based Models to Identify Factors Contributing to Trait Negative Affect in Adults With and Without Major Depression. https://doi.org/10.21203/rs.3.rs-2978274/v1
Castiglione‐Fontanellaz, C. E. G., & Tarokh, L. (2023). Sleep and Adolescent Depression. Clinical and Translational Neuroscience, 8(1), 3. https://doi.org/10.3390/ctn8010003
Chen, V. C., & Wu, S. I. (2025). An Exploratory Analysis on the Association Between Suicidal Ideation and the Microbiome in Patients With or Without Major Depressive Disorder. Journal of affective disorders, 370, 362-372. https://doi.org/10.1016/j.jad.2024.10.120
Frota, F. F., Araújo, L. P., Valenti, V. E., Eliana de Souza Bastos Mazuqueli, P., Detregiachi, C. R. P., Galhardi, C. M., Caracio, F. C. C., Laurindo, L. F., Tanaka, M., & Barbalho, S. M. (2025). Neuroinflammation and Natural Antidepressants: Balancing Fire With Flora. Biomedicines, 13(5), 1129. https://doi.org/10.3390/biomedicines13051129
Ghafori, S. S., Yousefi, Z., Bakhtiari, E., mohammad hossein mohammadi mahdiabadi, h., & Hassanzadeh, G. (2024). Neutrophil-to-Lymphocyte Ratio as a Predictive Biomarker for Early Diagnosis of Depression: A Narrative Review. Brain Behavior & Immunity - Health, 36, 100734. https://doi.org/10.1016/j.bbih.2024.100734
Höller, Y., Urbschat, M. M., Kristófersson, G. K., & Olafsson, R. (2022). Predictability of Seasonal Mood Fluctuations Based on Self-Report Questionnaires and EEG Biomarkers in a Non-Clinical Sample. Frontiers in Psychiatry, 13. https://doi.org/10.3389/fpsyt.2022.870079
Huang, J., Hou, X., Li, M., Xue, Y., An, J., Wen, S., Wang, Z., Cheng, M., & Yue, J. (2023). A Composite of Blood-Based Biomarkers to Distinguish Major Depressive Disorder and Bipolar Disorder in Adolescents and Adults. https://doi.org/10.21203/rs.3.rs-3058571/v1
Johnson, D., Letchumanan, V., Thum, C., Thurairajasingam, S., & Lee, L. H. (2023). A Microbial-Based Approach to Mental Health: The Potential of Probiotics in the Treatment of Depression. Nutrients, 15(6), 1382. https://doi.org/10.3390/nu15061382
Kossowska-Wywiał, M., & Brzezicka, A. (2025). Nourishing the Brain or the Mood? Dietary Omega-3s for Psychological, but Not Cognitive Health. Nutrients, 18(1), 50. https://doi.org/10.3390/nu18010050
Marano, G. (2025). The Immune Mind: Linking Dietary Patterns, Microbiota, and Psychological Health. Nutrients, 18(1), 96. https://doi.org/10.3390/nu18010096
Mason, C. E., & Miller, J. J. (2025). The Clinical Use of Epigenetics in Psychiatry: A Narrative Review of Epigenetic Mechanisms, Key Candidate Genes, and Precision Psychiatry. Frontiers in Psychiatry, 16. https://doi.org/10.3389/fpsyt.2025.1671122
Merlo, G., Sugden, S., Rosenfeld, R. M., Baron, D., Karlsen, M., Keyes, S. A., McHugh, J., Miller, L. A., Nemeroff, C. B., Ramas, M.-E., Livingston, K. A., Williams, K. A., Wilson, K. P., Wong, W., & Viswanathan, R. (2026). Lifestyle Interventions for Major Depressive Disorder (MDD): An Expert Consensus Statement From the American College of Lifestyle Medicine. American Journal of Lifestyle Medicine, 20(4), 608-627. https://doi.org/10.1177/15598276251408353
Mestrom, A., Charlton, K., Thomas, S. J., Larkin, T., Walton, K., Elgellaie, A., & Kent, K. (2023). Higher Anthocyanin Intake Is Associated With Lower Depressive Symptoms in Adults With and Without Major Depressive Disorder. Food Science & Nutrition, 12(3), 2202-2209. https://doi.org/10.1002/fsn3.3850
Oliveira, M. A., Medeiros, R., Guerra, M. P., Pariante, C. M., & Fernandes, L. (2023). Emotional, Inflammatory, and Genetic Factors of Resilience and Vulnerability to Depression in Patients With Premenopausal Breast Cancer: A Longitudinal Study Protocol. PLoS One, 18(2), e0279344. https://doi.org/10.1371/journal.pone.0279344
Ortega, M. Á., Fraile‐Μartinez, O., García‐Montero, C., Dı́az, R., López-González, L., Monserrat, J., Barrena-Blázquez, S., Álvarez-Mon, M. Á., Lahera, G., & Álvarez‐Mon, M. (2024). Understanding Immune System Dysfunction and Its Context in Mood Disorders: Psychoneuroimmunoendocrinology and Clinical Interventions. Military Medical Research, 11(1). https://doi.org/10.1186/s40779-024-00577-w
Rizzi, R., Jornkokgoud, K., Ghomroudi, P. A., Stella, M., & Grecucci, A. (2025). The Dark Side of the Mood: Structural and Functional Fronto-Insular and Cerebellar Alterations Classify Major Depression. https://doi.org/10.1101/2025.04.09.25325506
Serretti, A. (2025). Anhedonia: Current and Future Treatments. Psychiatry and Clinical Neurosciences Reports, 4(1). https://doi.org/10.1002/pcn5.70088
Stoyanov, D., & Maes, M. H. (2021). How to Construct Neuroscience-Informed Psychiatric Classification? Towards Nomothetic Networks Psychiatry. World journal of psychiatry, 11(1), 1-12. https://doi.org/10.5498/wjp.v11.i1.1
Tang, S., Han, C., & Li, X. (2025). Toward Scalable Mental Health Screening: Gender-Sensitive Biomarkers From Portable Prefrontal EEG Devices. https://doi.org/10.21203/rs.3.rs-7197377/v1
Tio, E. S., Misztal, M., & Felsky, D. (2024). Evidence for the Biopsychosocial Model of Suicide: A Review of Whole Person Modeling Studies Using Machine Learning. Frontiers in Psychiatry, 14. https://doi.org/10.3389/fpsyt.2023.1294666
Vignapiano, A., Monaco, F., Pagano, C., Piacente, M., Farina, F., Petrillo, G., Sica, R., Marenna, A., Shin, J. I., Solmi, M., & Corrivetti, G. (2023). A Narrative Review of Digital Biomarkers in the Management of Major Depressive Disorder and Treatment-Resistant Forms. Frontiers in Psychiatry, 14. https://doi.org/10.3389/fpsyt.2023.1321345
Wenger, A., & Calabrese, P. (2021). Comparing Underlying Mechanisms of Depression in Multiple Sclerosis and Rheumatoid Arthritis. Journal of Integrative Neuroscience, 20(3). https://doi.org/10.31083/j.jin2003081
Xiao, J. (2023). Gender Differences in Major Depressive Disorder and Relevant Interventions. Lecture Notes in Education Psychology and Public Media, 3(1), 356-361. https://doi.org/10.54254/2753-7048/3/2022502
Zhang, J. (2024). The Analysis of Major Depressive Disorder. Theoretical and Natural Science, 63(1), 133-137. https://doi.org/10.54254/2753-8818/2024.17937

