Building of Informatics, Technology and Science
Vol 7 No 2 (2025): September 2025

Analisis Perbandingan Algoritma Random Forest dan K-Nearest Neighbors pada Klasifikasi Tingkat Stres Pekerja

Manurung, Syalom Kristian (Unknown)
Pratama, Irfan (Unknown)



Article Info

Publish Date
02 Sep 2025

Abstract

Work stress has become a prominent concern in the modern professional landscape, as it can lead to reduced productivity, diminished work quality, and decreased mental well-being among employees. This study aims to evaluate and compare the performance of two machine learning algorithms, namely Random Forest and K-Nearest Neighbors (KNN), in classifying levels of work stress. The data were obtained through an online questionnaire completed by 212 respondents from various employment sectors in Indonesia. The responses were converted from Likert scale to numerical values, grouped using the K-Means clustering method, and categorized into five levels of stress, ranging from no stress to very high stress. To address data imbalance, the Synthetic Minority Over-sampling Technique (SMOTE) was applied. The modeling process was conducted using three different data split scenarios, namely 90:10, 80:20, and 70:30, and evaluated using metrics such as accuracy, precision, recall, f1-score, and cross-validation. The findings indicate that the Random Forest algorithm consistently outperformed KNN across all scenarios. After applying SMOTE, both algorithms showed improved performance, with the Balanced Random Forest model achieving the highest accuracy and f1-score of 92 percent in the 70:30 scenario. These results suggest that combining Random Forest with SMOTE offers an effective and reliable solution for classifying work stress levels and could be developed as an objective and efficient early detection system.

Copyrights © 2025






Journal Info

Abbrev

bits

Publisher

Subject

Computer Science & IT

Description

Building of Informatics, Technology and Science (BITS) is an open access media in publishing scientific articles that contain the results of research in information technology and computers. Paper that enters this journal will be checked for plagiarism and peer-rewiew first to maintain its quality. ...