Model Pembelajaran Mesin untuk Deteksi Gangguan Tidur: Perbandingan Logistic Regression dan Random Forest
Abstrak
Sleep disorders must be classified accurately to enable early detection and proper treatment. However, previous studies remain limited because they often rely on a single method or suffer from imbalanced datasets. This study aims to compare the performance of Logistic Regression and Random Forest in classifying sleep disorders using the Sleep Health dataset from Kaggle. The dataset consists of 374 samples and 12 variables categorized into three classes: Insomnia, No Disorder, and Sleep Apnea. The data processing steps include cleaning, splitting the dataset, and balancing the classes using the SMOTE technique to address distribution imbalance. Model evaluation was conducted using Accuracy, precision, recall, F1-score, and confusion matrix. Our findings show that Logistic Regression achieved an Accuracy of 96%, while Random Forest obtained 92%. Scientifically, Logistic Regression demonstrated greater stability on balanced data, whereas Random Forest was more sensitive to variations introduced by oversampling. Model analysis revealed that frequency of nighttime awakenings, total sleep duration, perceived sleep quality, and symptoms such as snoring or breathing pauses were the most influential factors in detecting sleep disorders. These results indicate that simpler models can outperform more complex ones after class balancing, a finding that has not been widely reported in the existing sleep health literature.
Identifier
- DOI: https://doi.org/10.29408/edumatic.v9i3.32491
- OpenAlex: https://openalex.org/W7124730909

