Analisis Prediksi Risiko Depresi pada Remaja Menggunakan Random Forest dan Logistic Regression Berdasarkan Pola Penggunaan Media Sosial
Abstract
Depression is a common mental health disorder among students and can negatively affect psychological well-being and academic performance. This study aims to develop and compare depression classification models using Logistic Regression and Random Forest algorithms. The dataset consisted of 1,200 records with an imbalanced class distribution. The research process included data cleaning, categorical feature transformation using One-Hot Encoding, class balancing through the Synthetic Minority Oversampling Technique (SMOTE), data splitting into training and testing sets, and model training and evaluation. Model performance was assessed using accuracy, precision, recall, F1-score, and ROC-AUC metrics. The results indicate that Random Forest outperformed Logistic Regression, achieving an accuracy of 99.79%, precision of 100%, recall of 99.57%, F1-score of 99.79%, and ROC-AUC of 100%. In comparison, Logistic Regression achieved an accuracy of 96.37%, precision of 97.38%, recall of 95.30%, F1-score of 96.33%, and ROC-AUC of 99.60%. Feature importance analysis revealed that sleep duration, anxiety level, stress level, and daily social media usage were the most influential factors associated with depression. These findings suggest that Random Forest is an effective approach for supporting the early detection of depression based on individual characteristics and behavioral patterns among adolescents.
References
Afkarinah, I., Faizin, A., & Havy, A. Z. F. (2025). Klasifikasi Tingkat Keparahan Kecelakaan Kerja Menggunakan Algoritma Random Forest. https://doi.org/https://doi.org/10.61722/jssr.v3i6.6433
Asosiasi Penyelenggara Jasa Internet Indonesia (APJII). (2025). Survei Profil Internet Indonesia 2025. https://apjii.or.id
DataReportal. (2025). Digital 2025 Indonesia. https://datareportal.com/reports/digital-2025-indonesia
Do, H., Huang, K.-Y., Cheng, S., Njiru, L. N., Mwavua, S. M., Obondo, A. A., & Kumar, M. (2025). Apply Machine Learning to Predict Risk for Adolescent Depression in a Cohort of Kenyan Adolescents. Healthcare, 13(20), 2620. https://doi.org/10.3390/healthcare13202620
Dong, Y., Wen, H., Lu, C., Li, J., & Zheng, Q. (2025). Predicting depression risk with machine learning models: identifying familial, personal, and dietary determinants. BMC Psychiatry, 25(1), 883. https://doi.org/10.1186/s12888-025-07182-8
Fassi, L., Thomas, K., Parry, D. A., Leyland-Craggs, A., Ford, T. J., & Orben, A. (2024). Social Media Use and Internalizing Symptoms in Clinical and Community Adolescent Samples: A Systematic Review and Meta-Analysis. JAMA Pediatrics, 178(8), 814–822. https://doi.org/10.1001/jamapediatrics.2024.2078
Gohari, M. R., & others. (2024). Using random forest to identify correlates of depression symptoms among adolescents. Social Psychiatry and Psychiatric Epidemiology, 59, 2063–2071. https://doi.org/10.1007/s00127-024-02695-1
Ke, H., Xu, A., Zhou, H., Chen, J., Wu, W., He, Q., & Cao, H. (2025). Machine learning models of depression in middle-aged and older adults with cardiovascular metabolic diseases. Journal of Affective Disorders, 387, 119494. https://doi.org/10.1016/j.jad.2025.119494
Khalaf, A. M., Alubied, A. A., Khalaf, A. M., & Rifaey, A. A. (2023). The Impact of Social Media on the Mental Health of Adolescents and Young Adults: A Systematic Review. Cureus, 15(8), e42990. https://doi.org/10.7759/cureus.42990
Liu, X., & others. (2025). Identification of depressive symptoms in adolescents using machine learning combining childhood and adolescence features. BMC Public Health, 25, 264. https://doi.org/10.1186/s12889-025-21506-z
LoParo, D., Matos, A. P., Arnarson, E. Ö., & Craighead, W. E. (2025). Enhancing prediction of major depressive disorder onset in adolescents: A machine learning approach. Journal of Psychiatric Research, 182, 235–242. https://doi.org/10.1016/j.jpsychires.2025.01.007
Mardini, M. T., & others. (2025). Identifying Adolescent Depression and Anxiety Through Real-World Data and Social Determinants of Health: Machine Learning Model Development and Validation. JMIR Mental Health, 12, e66665. https://doi.org/10.2196/66665
Nagata, J. M., & others. (2025). Social Media Use and Depressive Symptoms During Early Adolescence. JAMA Network Open, 8(5), e2511704. https://doi.org/10.1001/jamanetworkopen.2025.11704
Schønning, V., Hjetland, G. J., Aarø, L. E., & Skogen, J. C. (2020). Social Media Use and Mental Health and Well-Being Among Adolescents - A Scoping Review. Frontiers in Psychology, 11, 1949. https://doi.org/10.3389/fpsyg.2020.01949
Twivy, E., Freeman, D., Anderson, C., Loe, B. S., & Waite, F. (2025). The social media scale for depression in adolescence. International Journal of Adolescence and Youth, 30(1). https://doi.org/10.1080/02673843.2025.2450425
Twivy, E., & others. (2025). The social media scale for depression in adolescence. International Journal of Adolescence and Youth, 30(1), 02673843.2025.2450425. https://doi.org/10.1080/02673843.2025.2450425
Valkenburg, P. M., Meier, A., & Beyens, I. (2022). Social media use and its impact on adolescent mental health: An umbrella review of the evidence. Current Opinion in Psychology, 44, 58–68. https://doi.org/10.1016/j.copsyc.2021.08.017
Wu, J., Wu, X., Tarimo, C. S., & Zhao, W. (2025). Network analysis of Internet addiction and depression among Chinese adolescents. Journal of Affective Disorders, 119–127.
Wumaierjiang, N., Yan, G., Yuan, L., Song, J., Hou, X., Li, M., Sun, L., Zhou, J., Yin, H., & Xu, G. (2025). Predicting adolescent depressive symptoms using teacher-reported textual descriptions of abnormal behaviors: a study based on machine learning. Frontiers in Artificial Intelligence, 8. https://doi.org/10.3389/frai.2025.1732682
Zeng, S. X. (2026). Contemporary adolescent depression: Multidimensional analysis from neurobiological, psychological, and social integrative perspectives. World Journal of Psychiatry, 16(3), 113125. https://doi.org/10.5498/wjp.v16.i3.113125
Zhang, H., Yu, P., Liu, X., & Wang, K. (2024). Predictive factors for the development of depression in children and adolescents: a clinical study. Frontiers in Psychiatry, 15, 1460801. https://doi.org/10.3389/fpsyt.2024.1460801
Zhou, Y., Xu, H., Gong, J. P., Wan, T., & others. (2024). Identifying the risk of depression in a large sample of adolescents: An artificial neural network based on random forest. Journal of Adolescence, 96(7), 1485–1497. https://doi.org/10.1002/jad.12357


