A Comparative Evaluation of Random Forest, SVM, KNN, Logistic Regression, and Gradient Boosting for Stress Prediction
Abstract
Student stress has become a critical concern in contemporary education, necessitating early detection systems to enable timely intervention. This study presents a comprehensive comparative evaluation of five machine learning algorithms Logistic Regression, K-Nearest Neighbors (KNN), Support Vector Machine (SVM), Random Forest, and Gradient Boosting for classifying student stress levels into three categories (low, moderate, high). Using a dataset of 14,003 students with 14 academic, demographic, and psychosocial features, the research addresses the significant class imbalance (high stress: 50.7%, moderate: 29.1%, low: 20.2%) through systematic multi-metric assessment. Random Forest with 300 trees and class_weight='balanced' demonstrated superior performance across all metrics: accuracy (93.47%), precision (93.97%), recall (93.47%), F1-score (93.43%), and ROC-AUC (0.992). Feature importance analysis identified AssignmentCompletion, Attendance, and ExamScore as the most influential predictors. The contributions of this research include: (1) a comprehensive comparative evaluation of five foundational ML algorithms on a large-scale imbalanced educational dataset; (2) the explicit demonstration of Random Forest's effectiveness in handling class imbalance through built-in class weighting; (3) the identification of key academic predictors of student stress through feature importance analysis; and (4) the provision of a scalable evidence-based framework for early stress detection with practical implementation guidance for educational institutions.
Downloads
References
D. M. Ampuero, E. M. Arias, and D. A. Subiaga, “Comparison of Machine Learning Techniques for the Early Detection of Stress in University Students,” in 2025 IEEE Ninth Ecuador Technical Chapters Meeting (ETCM), 2025, pp. 1–6. doi: 10.1109/ETCM67548.2025.11304474.
S. Jaiswal, J. Darvai, L. Sahu, and N. Gupta, “Clustering Students Based on Learning Styles: A Machine Learning Approach for Personalized Education,” in 2025 World Skills Conference on Universal Data Analytics and Sciences (WorldSUAS), 2025, pp. 1–7. doi: 10.1109/WorldSUAS66815.2025.11198965.
A. Rahman, M. M. M. Syeed, K. Fatema, R. H. Khan, M. S. Hossain, and M. F. Uddin, “An Interpretable Hybrid CNN-SVM Model for Predicting Stress Among University Students,” in 2024 IEEE/ACS 21st International Conference on Computer Systems and Applications (AICCSA), 2024, pp. 1–8. doi: 10.1109/AICCSA63423.2024.10912575.
M. S. I. Ovi, J. Hossain, M. R. A. Rahi, and F. Akter, “Protecting Student Mental Health with a Context-Aware Machine Learning Framework for Stress Monitoring,” in 2026 IEEE 2nd International Conference on Quantum Photonics, Artificial Intelligence & Networking (QPAIN), 2026, pp. 1–6. doi: 10.1109/QPAIN69676.2026.11546676.
R. R. Putra, D. R. Wijaya, W. Febiyanti, and M. R. Ramadhana, “Student Stress Level Prediction using Voting Classifier based on Random Forest and XGBoost,” in 2026 IEEE International Conference on Industry 4.0, Artificial Intelligence, and Communications Technology (IAICT), 2026, pp. 683–689. doi: 10.1109/IAICT71158.2026.11620866.
G. Du, “An Enhanced Ensemble Optimized Machine Learning Framework for the Prediction and Assessment of Students’ Mental Stress,” in 2025 International Conference on Intelligent Communication Networks and Computational Techniques (ICICNCT), 2025, pp. 1–6. doi: 10.1109/ICICNCT66124.2025.11233120.
A. Mojumder, N. Suraya, N. T. Tandra, and Mohaimen-Bin-Noor, “Detecting Stress Levels using Physiological Signals,” in 2026 IEEE 2nd International Conference on Quantum Photonics, Artificial Intelligence & Networking (QPAIN), 2026, pp. 1–6. doi: 10.1109/QPAIN69676.2026.11546300.
D. Li, L. Li, Y. Liu, and S. Tan, “Research on Environmental Temperature Prediction Model Based on Improved Random Forest Algorithm,” in 2025 IEEE 3rd International Conference on Electrical, Automation and Computer Engineering (ICEACE), 2025, pp. 263–266. doi: 10.1109/ICEACE67491.2025.11439150.
F. W. Wibowo and Wihayati, “Knowledge-Based Recommendations and Clustering for Determining Agricultural Crops,” in 2025 International Conference on Computer Sciences, Engineering, and Technology Innovation (ICoCSETI), 2025, pp. 956–961. doi: 10.1109/ICoCSETI63724.2025.11019930.
S. Rajeswari, R. Gomathi, and I. Sujitha, “Tree-Based Multiclass Learning Model for Physiological Stress Detection from Students Community,” in 2024 International Conference on Intelligent Systems for Cybersecurity (ISCS), 2024, pp. 1–6. doi: 10.1109/ISCS61804.2024.10581339.
M. Huotari and K. Främling, “Event Classification with Imbalanced and Missing Data for an Air-Handling Unit,” in 2022 IEEE 5th International Conference on Big Data and Artificial Intelligence (BDAI), 2022, pp. 82–86. doi: 10.1109/BDAI56143.2022.9862614.
Y. Y. Munaye, A. Molla, Y. Belayneh, and B. Simegnew, “Long Short-Term Memory and Synthetic Minority Over Sampling Technique-Based Network Traffic Classification,” in 2024 International Conference on Information and Communication Technology for Development for Africa (ICT4DA), 2024, pp. 120–124. doi: 10.1109/ICT4DA62874.2024.10777078.
F. W. Wibowo, A. Sunyoto, B. Setiaji, and W. Wihayati, “Knowledge-Based Decision Support System for Determining Types of Agricultural Crops According to Soil Conditions,” Journal of Computer System and Informatics (JoSYC), vol. 6, no. 1, pp. 253–264, 2024, doi: 10.47065/josyc.v6i1.6254.
F. W. Wibowo, A. Dahlan, and Wihayati, “Detection of Fake News and Hoaxes on Information from Web Scraping using Classifier Methods,” in 2021 4th International Seminar on Research of Information Technology and Intelligent Systems (ISRITI), 2021, pp. 178–183. doi: 10.1109/ISRITI54043.2021.9702824.
E. Jose and A. C. Fong, “Integrating Scikit-learn with Langflow: A Low-Code Approach to Machine Learning Education,” in 2025 International Conference on Intelligent & Innovative Practices in Engineering & Management (IIPEM), 2025, pp. 1–7. doi: 10.1109/IIPEM65914.2025.11548510.
D. Nsanzabandi and P. Nizeyimana, “Enhancing Malaria Incidence Prediction Using Weather Variables: A Comparative Study of Gradient Boosting and Random Forest Regression Models,” in 2024 IEEE SmartBlock4Africa, 2024, pp. 1–10. doi: 10.1109/SmartBlock4Africa61928.2024.10779551.
O. Xu, Y. Ren, Y. Liang, M. Liu, C. Li, and L. Liu, “Construction of Online Distance Learning Risk Prediction Model Based on Data Mining,” in 2021 Tenth International Conference of Educational Innovation through Technology (EITT), 2021, pp. 58–62. doi: 10.1109/EITT53287.2021.00020.
S. S. Malik and A. Khan, “Anxiety, Depression and Stress prediction among College Students using Machine Learning Algorithms,” in 2023 Second International Conference on Electrical, Electronics, Information and Communication Technologies (ICEEICT), 2023, pp. 1–5. doi: 10.1109/ICEEICT56924.2023.10157693.
P. Ozturk, O. Olawale-Akintola, and K. Dimililer, “A Multimodal Data Fusion Approach for Early Mental Health Risk Detection in College Students Using Logistic Regression and Random Forest,” in 2026 2nd International Symposium on AI-Driven Engineering Systems (ISADES), 2026, pp. 1–8. doi: 10.1109/ISADES69945.2026.11608079.
X. Ding et al., “Impute4TSC: Evaluating Missing Value Imputation Methods for Time Series Classification,” in 2025 IEEE 41st International Conference on Data Engineering Workshops (ICDEW), 2025, pp. 127–135. doi: 10.1109/ICDEW67478.2025.00023.
L. Demidova and Y. Sokolova, “A novel SVM-kNN technique for data classification,” in 2017 6th Mediterranean Conference on Embedded Computing (MECO), 2017, pp. 1–4. doi: 10.1109/MECO.2017.7977132.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel A Comparative Evaluation of Random Forest, SVM, KNN, Logistic Regression, and Gradient Boosting for Stress Prediction
Pages: 933-945
Copyright (c) 2026 Janur Alaudin Syah, Sumiyatun Sumiyatun

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).





















