Classification of Sleep Disorders Based on Lifestyle using K-Nearest Neighbors Algorithm
Alam Rahmatulloh, Yasmin Indah Hasari, Erna Haerani, Irfan Darmawan, Rohmat Gunawan, Randi Rizal · 2025
sleep disorders are abnormalities in sleep patterns caused by lifestyle, mental and physical health conditions. Given the huge impact of sleep disorders on health and quality of life. The aim of this study is to classify sleep disorders based on lifestyle using the K-Nearest Neighbors algorithm. The dataset used comes from Kaggle, namely Sleep Health and Lifestyle, which contains data related to sleep patterns, lifestyle, and individual healthIn order to mitigate class imbalances, the Synthetic Minority Oversampling Technique (SMOTE) is implemented. To determine the best k value in KNN, the Elbow Method is applied, resulting in an optimal k value of 3. The evaluation matrix used in this study includes precision, recall, f1-score, and confusion matrix. The results show that SMOTE improves classification, increasing accuracy from 88% to 91%. Some misclassifications persist due to feature overlap. Therefore, future work should explore feature selection and increase the dataset size. Additionally, exploring models such as Random Forest, Support Vector Machine, or deep learning-based algorithms can be done to compare performance and improve accuracy.