Diabetes mellitus is a non-communicable disease with a steadily increasing prevalence in Indonesia, including Aceh Province. Early detection using data-driven approaches is essential to minimize the risk of severe complications. This study aims to classify diabetes mellitus by implementing the K-Nearest Neighbors (KNN) algorithm. The dataset comprises 1,500 instances from the Pima Indians Diabetes Dataset obtained from Kaggle and an additional 100 instances collected from hospitals across Aceh Province. Data preprocessing involved normalization and label encoding, followed by data partitioning into training and testing sets using a 90:10 ratio. The KNN model was configured with a parameter value of K=5. Experimental results indicate that the proposed model achieved an accuracy of 85%, precision of 87%, recall of 82%, and an F1-score of 85% on the Kaggle dataset. For the hospital dataset, the model attained an accuracy of 76%, precision of 80.95%, recall of 68%, and an F1-score of 73.91%. These findings suggest that the KNN algorithm demonstrates adequate performance in classifying diabetes mellitus and may serve as a basis for the development of data-driven medical decision support systems.
Copyrights © 2026