Preprint has been submitted for publication in journal
Preprint / Version 1

Implementation of the Random Forest Algorithm for Classifying University Students' Stress Levels Based on DASS-21 Questionnaire Data

Implementasi Random Forest untuk Klasifikasi Tingkat Stres Mahasiswa Berdasarkan Data Kuesioner DASS-21

##article.authors##

DOI:

https://doi.org/10.21070/ups.11471

Keywords:

Random Forest, classification, student stress, DASS-21, machine learning

Abstract

Stress is a common psychological problem among students caused by academic pressure, achievement demands, and personal and social factors. Rapid and accurate identification of stress levels is essential to support timely interventions, yet manual assessment is often time-consuming and prone to errors. This study implements the Random Forest algorithm to classify student stress levels using DASS-21 questionnaire data. The dataset consists of 1,000 respondents and underwent preprocessing, including cleaning, scoring, labeling, and encoding. The data were divided into training and testing sets using an 80:20 ratio. Model training was performed using the Random Forest algorithm with hyperparameter optimization through GridSearchCV. The optimal parameters were n_estimators = 200, max_depth = 10, min_samples_split = 2, and min_samples_leaf = 1. The model achieved an accuracy of 73.50%, precision of 74.17%, recall of 73.50%, and an F1-score of 73.61%, demonstrating reliable performance in classifying student stress levels.

Downloads

Download data is not yet available.

References

Thasya Nur Oktaviona, Herlina, and T. H. Sari, “Faktor Yang Mempengaruhi Tingkat Stres Pada Mahasiswa Akhir,” J. Keperawatan Trop. Papua, vol. 6, no. 1, pp. 26–32, 2023, doi: 10.47539/jktp.v6i1.344.

W. Musikhah and D. Nastiti, “Academic Stress of University of Muhammadiyah Sidoarjo Students Who Study While Working Class of 2021,” J. Islam. Muhammadiyah Stud., vol. 2, pp. 1–6, 2022, doi: https://doi.org/10.21070/jims.v2i0.1543.

Q. Nada, I. Herdiana, and F. Andriani, “Testing the validity and reliability of the Depression Anxiety Stress Scale (DASS)-21 instrument for individuals with Psychodermatology,” Psikohumaniora, vol. 7, no. 2, pp. 153–168, 2022, doi: 10.21580/pjpp.v7i2.11802.

A. S. N. Isha et al., “Validation of ‘Depression, Anxiety, and Stress Scales’ and ‘Changes in Psychological Distress during COVID-19’ among University Students in Malaysia,” Sustain., vol. 15, no. 5, 2023, doi: 10.3390/su15054492.

R. Rois, M. Ray, A. Rahman, and S. K. Roy, “Prevalence and predicting factors of perceived stress among Bangladeshi university students using machine learning algorithms,” J. Heal. Popul. Nutr., vol. 40, no. 1, pp. 1–12, 2021, doi: 10.1186/s41043-021-00276-5.

S. Arya, Anju, and N. A. Ramli, “Predicting the stress level of students using Supervised Machine Learning and Artificial Neural Network (ANN),” Indian J. Eng., vol. 21, no. 56, 2024, doi: 10.54905/disssi.v21i55.e9ije1684.

K. Rahayu, V. Fitria, D. Septhya, and ..., “Klasifikasi Teks untuk Mendeteksi Depresi dan Kecemasan pada Pengguna Twitter Berbasis Machine Learning: Text Classification for Detecting Depression and …,” MALCOM Indones. J. Mach. Learn. Comput. Sci., vol. 3, no. 2, pp. 108–114, 2023, doi: https://doi.org/10.57152/malcom.v3i2.780.

I. Adriansyah, M. D. Mahendra, E. Rasywir, and Y. Pratama, “Perbandingan Metode Random Forest Classifier dan SVM Pada Klasifikasi Kemampuan Level Beradaptasi Pembelajaran Jarak Jauh Siswa,” Bull. Informatics Data Sci., vol. 1, no. 2, pp. 98–103, 2022, doi: http://dx.doi.org/10.61944/bids.v1i2.49.

D. Haganta Depari, Y. Widiastiwi, and M. Mega Santoni, “Perbandingan Model Decision Tree, Naive Bayes dan Random Forest untuk Prediksi Klasifikasi Penyakit Jantung,” J. Inform., vol. 18, no. 3, pp. 239–248, Dec. 2022, doi: https://doi.org/10.52958/iftk.v18i3.4694.

A. Yusuf Permana, H. Noer Fazri, M. Fakhrizal Nur Athoilah, M. Robi, and R. Firmansyah, “Penerapan Data Mining Dalam Analisis Prediksi Kanker Paru Menggunakan Algoritma Random Forest,” J. Ilm. Tek. Inform. dan Komun., vol. 3, no. 2, pp. 27–41, Jun. 2023, doi: https://doi.org/10.35970/infotekmesin.v14i1.1751.

M. L. Wallace et al., “Use and misuse of random forest variable importance metrics in medicine: demonstrations through incident stroke prediction,” BMC Med. Res. Methodol., vol. 23, no. 1, pp. 1–12, 2023, doi: 10.1186/s12874-023-01965-x.

L. Langsetmo et al., “Advantages and Disadvantages of Random Forest Models for Prediction of Hip Fracture Risk Versus Mortality Risk in the Oldest Old,” JBMR Plus, vol. 7, no. 8, pp. 1–11, 2023, doi: 10.1002/jbm4.10757.

Y. Rothacher and C. Strobl, Identifying Informative Predictor Variables With Random Forests, vol. 49, no. 4. 2024. doi: 10.3102/10769986231193327.

R. Ririn, A. Rizki Rinaldi, and F. M Basysyar, “Prediksi Kesehatan Mental Menggunakan Random Forest Berdasarkan Faktor Demografi Dan Lingkungan Kerja,” JATI (Jurnal Mhs. Tek. Inform., vol. 9, no. 3, pp. 4515–4522, 2025, doi: 10.36040/jati.v9i3.13720.

D. Fuji Astari, Y. Herry Chrisnanto, and M. Melina, “KLASIFIKASI TINGKAT STRES SAAT TIDUR MENGGUNAKAN ALGORITMA RANDOM FOREST,” JATI (Jurnal Mhs. Tek. Inform., vol. 7, no. 5, pp. 3676–3684, 2024, doi: 10.36040/jati.v7i5.7750.

Oon Wira Yuda, Darmawan Tuti, Lim Sheih Yee, and Susanti, “Penerapan Data Mining Untuk Klasifikasi Kelulusan Mahasiswa Tepat Waktu Menggunakan Metode Random Forest,” SATIN - Sains dan Teknol. Inf., vol. 8, no. 2, pp. 122–131, Dec. 2022, doi: 10.33372/stn.v8i2.885.

A. Hapsari, A. S. Nursuwanda, H. Zuhriyah, and D. J. Vresdian, “Klasifikasi Kesehatan Mental Mahasiswa Model TMAS dengan Algoritma Decision Tree, Logistic Regression, dan Random Forest,” INTEK J. Inform. dan Teknol. Inf., vol. 7, no. 2, pp. 55–64, 2024, doi: 10.37729/intek.v7i2.5690.

L. Pefrianti, I. R. Munthe, I. Irmayanti, and M. Masrizal, “Klasifikasi Tingkat Stres Mahasiswa Dalam Penyelesaian Tugas Akhir Menggunakan Naïve Bayes Dan K-Nearest Neighbor,” J. Comput. Sci. Inf. Syst., vol. 7, no. 1, pp. 129–137, 2026, doi: https://doi.org/10.36987/jcoins.v7i1.9060.

M. Chanafy and H. Sulistiani, “Comparative Analysis Of Machine Learning Algorithm Performance For Student Mental Health Classification,” SMATIKA STIKI Inform. J., vol. 16, no. 1, pp. 19–29, 2026, doi: https://doi.org/10.32664/smatika.v16i01.2080.

I. M. M. Matin, “Hyperparameter Tuning Menggunakan GridsearchCV pada Random Forest untuk Deteksi Malware,” Multinetics, vol. 9, no. 1, pp. 43–50, 2023, doi: 10.32722/multinetics.v9i1.5578.

M. A. Rosid, F. Muharram, and G. R. Affandi, “Perbandingan Kinerja Algoritma Machine Learning Untuk Mendeteksi Kalimat Sarkasme Dalam Bahasa Indonesia,” Procedia Soc. Sci. Humanit., vol. 3, no. c, pp. 1192–1195, 2022, doi: https://doi.org/10.21070/pssh.v3i.253.

J. W. Creswell and J. D. Creswell, Research Design: Qualitative, Quantitative, and Mixed Methods Approaches. SAGE Publications, 2022. [Online]. Available: https://books.google.co.id/books?id=Rkh4EAAAQBAJ

M. U. Nadeem, S. J. Kulich, and I. H. Bokhari, “The assessment and validation of the depression, anxiety, and stress scale (DASS-21) among frontline doctors in Pakistan during fifth wave of COVID-19,” Front. Public Heal., vol. 11, 2023, doi: 10.3389/fpubh.2023.1192733.

Y. A. Prasetyo, E. Utami, and A. Yaqin, “Pengaruh Komposisi Split Data Terhadap Performa Akurasi Analisis Sentimen Algoritma Naïve Bayes dan SVM,” J. Electr. Eng. Comput., vol. 6, no. 2, pp. 382–390, 2024, doi: 10.33650/jeecom.v6i2.9188.

Posted

2026-08-05