Random Forest Based Prediction of Student Stress Levels from Digital Activity Data

Alphin Stephanus, Sri W. Ginting, Junus J. S. Kufla, Syukri G. Suatkab, Thenny D. Salamoni

Abstract


Early-semester students experience academic adaptation while relying intensively on digital devices, creating a need for accessible, non clinical stress screening. This study aimed to determine whether six self-reported digital-activity variables could distinguish low, moderate, and high DASS-21 derived stress categories and support a student facing screening prototype. A quantitative cross sectional survey and software prototyping design involved 66 Informatics Engineering students. The analytical procedure combined median imputation, standardization, SMOTE within each training fold, Random Forest classification, repeated stratified five fold cross validation with ten repeats, comparison algorithms, class-specific metrics, permutation importance, learning-curve analysis, and functional testing. Metric auditing produced a single out of fold accuracy of 62.12% and macro F1-score of 53.88%. Under repeated validation, the SMOTE Random Forest pipeline achieved 61.97 ± 10.92% accuracy and 55.82 ± 9.87% macro F1-score. The majority DummyClassifier obtained higher accuracy at 65.16 ± 3.47% but only 26.29 ± 0.84% macro F1-score and zero recall for moderate and high stress. SMOTE Random Forest recall was 20.67 ± 23.94% for moderate stress and 80.00 ± 30.00% for high stress. Logistic Regression produced the highest comparison-model accuracy of 70.89%, although its macro F1-score of 55.23% was slightly below that of SMOTE Random Forest. Total screen time was the only predictor with clearly positive permutation importance. Overlapping feature distributions, unstable minority class estimates, and a persistent training validation gap limited performance. StresCheck therefore constitutes an exploratory proof of concept and requires larger, balanced, externally validated data before screening deployment.

Keywords


Student Stress; Digital Activity; Random Forest; DASS-21; Streamlit

Full Text:

Link Download

References


Abdulsadig, R. S., & Rodriguez-Villegas, E. (2024). A comparative study in class imbalance mitigation when working with physiological signals. Frontiers in Digital Health, 6. https://doi.org/10.3389/fdgth.2024.1377165

Beny, B. (2026). Performance Analysis of Ensemble Learning Models in Heart Failure Prediction: Random Forest, AdaBoost, and XGBoost. Telematika, 19(1), 1–10. https://doi.org/10.35671/telematika.v19i1.3218

Boers, E., Afzali, M. H., Newton, N., & Conrod, P. (2019). Association of Screen Time and Depression in Adolescence. In JAMA Pediatrics (Vol. 173, Number 9, pp. 853–859). American Medical Association. https://doi.org/10.1001/jamapediatrics.2019.1759

Currey, D., & Torous, J. (2022). Digital Phenotyping Data to Predict Symptom Improvement and App Personalization: Protocol for a Prospective Study. JMIR Research Protocols, 11(11). https://doi.org/10.2196/37954

Daud, N. M. (2025). From innovation to stress: analyzing hybrid technology adoption and its role in technostress among students. International Journal of Educational Technology in Higher Education, 22(1). https://doi.org/10.1186/s41239-025-00529-x

Daza, A., Saboya, N., Necochea-Chamorro, J. I., Zavaleta Ramos, K., & Vásquez Valencia, Y. del R. (2023). Systematic review of machine learning techniques to predict anxiety and stress in college students. In Informatics in Medicine Unlocked (Vol. 43). Elsevier Ltd. https://doi.org/10.1016/j.imu.2023.101391

Defit, S., Windarto, A. P., & Alkhairi, P. (2024). Comparative Analysis of Classification Methods in Sentiment Analysis: The Impact of Feature Selection and Ensemble Techniques Optimization. Telematika, 17(1), 52–67. https://doi.org/10.35671/telematika.v17i1.2824

Dessauvagie, A. S., Dang, H. M., Nguyen, T. A. T., & Groen, G. (2022). Mental Health of University Students in Southeastern Asia: A Systematic Review. In Asia-Pacific Journal of Public Health (Vol. 34, Numbers 2–3, pp. 172–181). SAGE Publications Inc. https://doi.org/10.1177/10105395211055545

Drira, M., Ben Hassine, S., Zhang, M., & Smith, S. (2024). Machine Learning Methods in Student Mental Health Research: An Ethics-Centered Systematic Literature Review. In Applied Sciences (Switzerland) (Vol. 14, Number 24). Multidisciplinary Digital Publishing Institute (MDPI). https://doi.org/10.3390/app142411738

Hilda, & Roy Purwanto, M. (2024). PENGARUH MEDIA SOSIAL TERHADAP KESEJAHTERAAN MENTAL MAHASISWA: STUDI KASUS DI FAKULTAS ILMU AGAMA ISLAMA UNIVERSITAS ISLAM INDONESIA. At-Thullab : Jurnal Mahasiswa Studi Islam, 6(1), 1485–1486. https://doi.org/10.20885/tullab.vol6.iss1.art2

Jamilah, F. N. (2026). IMPLEMENTASI DATA MINING UNTUK PREDIKSI DAN KLASIFIKASI TINGKAT STRES MENGGUNAKAN ALGORITMA RANDOM FOREST. Jurnal Informatika Dan Teknik Elektro Terapan, 14(1). https://doi.org/10.23960/jitet.v14i1.8838

Ku, W. L., & Min, H. (2024). Evaluating Machine Learning Stability in Predicting Depression and Anxiety Amidst Subjective Response Errors. Healthcare (Switzerland), 12(6). https://doi.org/10.3390/healthcare12060625

Malik, M., & Javed, S. (2021). Perceived stress among university students in Oman during COVID-19-induced e-learning. Middle East Current Psychiatry, 28(1). https://doi.org/10.1186/s43045-021-00131-7

Mittal, S., Mahendra, S., Sanap, V., & Churi, P. (2022). How can machine learning be used in stress management: A systematic literature review of applications in workplaces and education. In International Journal of Information Management Data Insights (Vol. 2, Number 2). Elsevier B.V. https://doi.org/10.1016/j.jjimei.2022.100110

Pereira, M. G., Santos, M., Magalhães, R., Rodrigues, C., Araújo, O., & Durães, D. (2025). Burnout Risk Profiles in Psychology Students: An Exploratory Study with Machine Learning. Behavioral Sciences, 15(4). https://doi.org/10.3390/bs15040505

Ratul, I. J., Nishat, M. M., Faisal, F., Sultana, S., Ahmed, A., & Al Mamun, M. A. (2023). Analyzing Perceived Psychological and Social Stress of University Students: A Machine Learning Approach. Heliyon, 9(6). https://doi.org/10.1016/j.heliyon.2023.e17307

Razavi, M., Ziyadidegan, S., Mahmoudzadeh, A., Kazeminasab, S., Baharlouei, E., Janfaza, V., Jahromi, R., & Sasangohar, F. (2024). Machine Learning, Deep Learning, and Data Preprocessing Techniques for Detecting, Predicting, and Monitoring Stress and Stress-Related Mental Disorders: Scoping Review. In JMIR Mental Health (Vol. 11). JMIR Publications Inc. https://doi.org/10.2196/53714

Sa’diyah, M., Naskiyah, N., & Rosyadi, A. R. (2022). Hubungan Intensitas Penggunaan Media Sosial Dengan Kesehatan Mental Mahasiswa Dalam Pendidikan Agama Islam. Edukasi Islami: Jurnal Pendidikan Islam, 11(03), 713. https://doi.org/10.30868/ei.v11i03.2802

Sharif, M. S., Raj Theeng Tamang, M., Fu, C. H. Y., Baker, A., Alzahrani, A. I., & Alalwan, N. (2023). An Innovative Random-Forest-Based Model to Assess the Health Impacts of Regular Commuting Using Non-Invasive Wearable Sensors. Sensors, 23(6). https://doi.org/10.3390/s23063274

Shvetcov, A., Funke Kupper, J., Zheng, W. Y., Slade, A., Han, J., Whitton, A., Spoelma, M., Hoon, L., Mouzakis, K., Vasa, R., Gupta, S., Venkatesh, S., Newby, J., & Christensen, H. (2024). Passive sensing data predicts stress in university students: a supervised machine learning method for digital phenotyping. Frontiers in Psychiatry, 15. https://doi.org/10.3389/fpsyt.2024.1422027

Tufail, S., Riggs, H., Tariq, M., & Sarwat, A. I. (2023). Advancements and Challenges in Machine Learning: A Comprehensive Review of Models, Libraries, Applications, and Algorithms. In Electronics (Switzerland) (Vol. 12, Number 8). MDPI. https://doi.org/10.3390/electronics12081789

Twenge, J. M., & Campbell, W. K. (2018). Associations between screen time and lower psychological well-being among children and adolescents: Evidence from a population-based study. Preventive Medicine Reports, 12, 271–283. https://doi.org/10.1016/j.pmedr.2018.10.003

Vos, G., Trinh, K., Sarnyai, Z., & Rahimi Azghadi, M. (2023). Ensemble machine learning model trained on a new synthesized dataset generalizes well for stress prediction using wearable devices. Journal of Biomedical Informatics, 148. https://doi.org/10.1016/j.jbi.2023.104556

Yang, S., & Berdine, G. (2024). Confusion matrix. The Southwest Respiratory and Critical Care Chronicles, 12(53), 75–79. https://doi.org/10.12746/swrccc.v12i53.1391




DOI: http://dx.doi.org/10.35671/telematika.v19i2.3416

Refbacks

  • There are currently no refbacks.


 



Indexed by:

   

Telematika
ISSN: 2442-4528 (online) | ISSN: 1979-925X (print)
Published by : Universitas Amikom Purwokerto
Jl. Let. Jend. POL SUMARTO Watumas, Purwonegoro - Purwokerto, Indonesia


Creative Commons License This work is licensed under a Creative Commons Attribution 4.0 International License .