Model Klasifikasi Cerdas Gangguan Tidur Berbasis Machine Learning Random Forest pada Data Kesehatan dan Perilaku Harian
Abstract
Sleep disorders, such as insomnia and sleep apnea, have become a significant health issue in the modern era, driven by the demands of lifestyle changes. This condition highlights the urgent need for early detection tools that are not only accurate but also easily accessible to the general public. This research aims to design and implement an intelligent classification system to automatically identify the risk of sleep disorders based on health and daily behavior data. To achieve this goal, this study applies a machine learning method using the Random Forest algorithm, which was chosen for its reliable ability to handle complex and non-linear data relationships. The data used is the "Sleep Health and Lifestyle Dataset" sourced from the Kaggle platform, covering 374 respondents with 13 relevant features. The research process included data pre-processing steps to ensure input quality, model training, and rigorous performance evaluation. The evaluation results on the test data show that the developed Random Forest model exhibited very solid performance, successfully achieving an accuracy rate of 91% and a weighted average F1-Score of 0.90. This F1-Score metric, which balances precision and recall, confirms that the model is not only accurate but also has a balanced performance in detecting each class, which is crucial for health classification. Furthermore, the feature importance analysis confirmed that Stress Level, BMI Category, and Heart Rate are the three most dominant predictor factors. The culmination of this research is the successful implementation of this predictive model into an interactive web application developed using the Streamlit framework. This application allows users to independently input their health data and receive feedback in the form of a real-time risk prediction. With an intuitive interface and easy-to-understand results, this application serves as a practical and informative initial screening tool for personal sleep health analysis.
Downloads
References
RSUP Prof. I. G. N. G. Ngoerah, Modul Materi Gangguan Tidur. Denpasar: Fakultas Kedokteran Universitas Udayana, 2022. [Online]. Available: https://neurologiudayana.com/wp-content/uploads/2024/06/11.-Modul-Gangguan-Tidur.pdf
A. M. Prakoso, Psikologi Tidur: Dari Kualitas Tidur hingga Insomnia. Jakarta: PT Elex Media Komputindo, 2020. [Online]. Available: https://opac.perpusnas.go.id/DetailOpac.aspx?id=1334119
A. I. Sharaf, "Sleep Apnea Detection Using Wavelet Scattering Transformation and Random Forest Classifier," Entropy, vol. 25, no. 3, 2023, DOI: 10.3390/e25030399.
I. A. Hidayat, “Classification of Sleep Disorders Using Random Forest on Sleep Health and Lifestyle Dataset,” Journal of DINDA: Data Science, Information Technology, and Data Analytics, vol. 3, no. 2, pp. 71–76, 2023. [Online]. Available: http://journal.ittelkom-pwt.ac.id/index.php/dinda. doi: 10.56855/dinda.v3i2.188
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," Bulletin of Informatics and Data Science, vol. 1, no. 2, pp. 98-103, Nov. 2022, doi: 10.61944/bids.v1i2.49.
S. Li, P. Zhu, G. Cai, J. Li, T. Huang, dan W. Tang, "Application Of Machine Learning Models In Predicting Insomnia Severity: An Integrative Approach With Constitution Of Traditional Chinese Medicine," Frontiers In Medicine, Vol. 10, Art. no. 1292761, 2023, doi: 10.3389/fmed.2023.1292761.
W. Widyastuty and M. A. Azis, “Classification and Evaluation of Sleep Disorders Using Random Forest Algorithm in Health and Lifestyle Dataset,” Compiler, vol. 13, no. 1, p. 11, May 2024, doi: 10.28989/compiler.v13i1.2184.
P. E. Sudiarti, R. R. Lestari, and P. Tuanku Tambusai, “Hubungan Gaya Hidup Dengan Kejadian Insomnia Pada Mahasiswa Prodi Teknik Informatika Universitas Pahlawan Tuanku Tambusai,” Jurnal Ners, vol. 6, no. 2, pp. 132–137, 2022, doi: 10.31004/jn.v6i2.7813
J. B. Putri Kristiani, L. Leokadja, and I. Binanto, “Perbandingan Metode Klasifikasi Random Forest dan Support Vector Machine Terhadap Dataset Resiko Kanker Serviks,” JTRISTE (Jurnal Teknologi Rekayasa Informasi dan Sains Terapan), vol. 11, no. 1, pp. 60–66, 2024, doi: 10.55645/jtriste.v11i1.507
A. Putranto, N. L. Azizah, I. Ratna, and I. Astutik, “Web-Based Heart Disease Prediction System Using SVM Method and Streamlit Framework [Sistem Prediksi Penyakit Jantung Berbasis Web Menggunakan Metode SVM dan Framework Streamlit],” Kesatria: Jurnal Penerapan Sistem Informasi (Komputer dan Manajemen), vol. 1, no. 1, pp. 1–10, 2023, doi: 10.21070/ups.1378
A. Satura, S. Ernawati, and F. Purnomosidi, “Kecemasan Pada Mahasiswa Insomnia,” Jurnal Asosiatif, vol. 4, no. 1, pp. 1–9, 2025, doi: 10.47942/asosiatif.v4i1.1848
D. Maulina, R. Anugrahwati, S. Adiana, P. K. Syafitri, V. Arianti, A. U. H. Rochjana, and A. D. Retnani, “Manajemen Komprehensif Insomnia Terkait Smartphone Pada Mahasiswa: Perspektif Keperawatan, Farmasi, Dan Fisioterapi,” Indonesian Journal of Health Science, vol. 5, no. 4, pp. 760–772, 2025, doi: 10.54957/ijhs.v5i4.1619.
L. Susanti, “Faktor-Faktor Yang Mempengaruhi Kejadian Insomnia Di Poliklinik Saraf RS DR. M. Djamil Padang,” Jurnal Kesehatan Andalas, vol. 4, no. 3, pp. 951–956, 2015, doi: 10.25077/jka.v4i3.391.
P. A. A. Krisnawan and M. P. D. Bajirani, “Intervensi untuk Menurunkan Insomnia pada Mahasiswa,” Jurnal Penelitian Inovatif, vol. 5, no. 2, pp. 2119–2130, May 2025, doi: 10.54082/jupin.1383.
Taufiq Fadli, A. Chairunnas, M. I. Suriansyah, and K. Kunci, “Deteksi Insomnia Menggunakan Sensor GSR dan Max30102 Metode Naïve Bayes,” Joutica (Journal Of Informatics Unisla), vol. 10, no. 1, pp. 115–123, 2025, doi: 10.30736/informatika.v10i1.1370
K. Inra Gunawan, Nurgahayu, and Haeruddin, “Faktor Determinan Kejadian Insomnia Pada Mahasiswa Tingkat Akhir Fakultas Kesehatan Masyarakat Universitas Muslim Indonesia,” Window Of Public Health Journal, vol. 3, no. 3, pp. 488–501, 2022, doi: 10.33096/woph.v3i3.104
A. Ananda Hapsari, A. Syafei Nursuwanda, H. Zuhriyah, and D. Junesco Vresdian, “Klasifikasi Kesehatan Mental Mahasiswa Model TMAS Dengan Algoritma Decision Tree, Logistic Regression, Dan Random Forest,” INTEK: Jurnal Informatika dan Teknologi Informasi, vol. 7, no. 2, pp. 101–109, 2024, doi: 10.37729/intek.v7i2.5690
V. Oktaviani, N. Rosmawarni, and M. Panji Muslim, “Perbandingan Kinerja Random Forest Dan SMOTE Random Forest Dalam Mendeteksi Dan Mengukur Tingkat Stres Pada Mahasiswa Tingkat Akhir,” Informatik: Jurnal Ilmu Komputer, vol. 20, no. 1, pp. 45–55, 2024, doi: 10.52958/iftk.v20i1.9158
P. L. Romadloni, B. A. Kusuma, and W. M. Baihaqi, "Komparasi Metode Pembelajaran Mesin Untuk Implementasi Pengambilan Keputusan Dalam Menentukan Promosi Jabatan Karyawan," JATI (Jurnal Mahasiswa Teknik Informatika), vol. 6, no. 2, 2022, DOI: 10.36040/jati.v6i2.5238
Abdah Syakiroh Gustian and Fathoni Mahardika, “Analisis Klasifikasi Risiko Dropout Mahasiswa Menggunakan Algoritma Decision Tree dan Random Forest,” Jupiter: Publikasi Ilmu Keteknikan Industri, Teknik Elektro dan Informatika, vol. 3, no. 4, pp. 182–189, Jul. 2025, doi: 10.61132/jupiter.v3i4.980.
D. Devalio, A. Anisya, A. Syahrani, I. Warman, and B. Busran, “PERANCANGAN WEBSITE UNTUK PREDIKSI JUMLAH PENGELUARAN MAHASISWA BERBASIS FRAMEWORK STREAMLIT,” Jurnal Informatika dan Teknik Elektro Terapan, vol. 13, no. 2, Apr. 2025, doi: 10.23960/jitet.v13i2.6451.
G. Ayu Syafarina and I. Kalimantan Muhammad Arsyad Al Banjari Banjarmasin, “Implementasi Framework Streamlit Sebagai Prediksi Harga Jual Rumah Dengan Linear Regresi,” vol. 7, p. 2023, doi: 10.47002/metik.v7i2.680.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Model Klasifikasi Cerdas Gangguan Tidur Berbasis Machine Learning Random Forest pada Data Kesehatan dan Perilaku Harian
Pages: 1717-1729
Copyright (c) 2025 Laila Maulin Ni'mah, Defri Kurniawan

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).





















