Building of Informatics, Technology and Science
Vol 6 No 4 (2025): March 2025

Perbandingan Kinerja Algoritma K-Nearest Neighbors dan Decision Tree untuk Klasifikasi Diabetes

Yunianto, Amar Haris (Unknown)
Subhiyakto, Egia Rosi (Unknown)



Article Info

Publish Date
16 Mar 2025

Abstract

Diabetes is a chronic metabolic disease that is a major concern in global health due to its increasing prevalence, including in Indonesia, with significant impacts on individual health and health systems. This study aims to compare the performance of K-Nearest Neighbors (KNN) and Decision Tree (DT) algorithms in diabetes classification using the Pima Indians Diabetes Database (PIDD) dataset. Research methods include data collection, pre-processing, missing value handling, outlier detection and handling, and data balancing techniques using Synthetic Minority Oversampling Technique (SMOTE) to overcome class imbalance in the dataset. Model implementation is done by optimizing parameters using GridSearchCV, while performance evaluation is done based on accuracy, precision, recall, and F1 score matrices. The results show that the DT algorithm has superior performance compared to KNN, both without SMOTE and with SMOTE. In the model without SMOTE, DT achieved 85.71% accuracy, while KNN only reached 83.12%. After applying SMOTE, the performance of both algorithms improved significantly, with DT achieving 92% accuracy, 94% precision, 90.38% recall, and 92.16% F1 score, while KNN achieved 91% accuracy, 96.59% recall, and 90.43% F1 score. This study revealed that the use of SMOTE effectively improved the model's performance in handling data imbalance, while the DT algorithm showed better performance stability. These findings are expected to make a significant contribution to the development of more accurate prediction models for diabetes diagnosis, while enriching insights into the application of machine learning in the healthcare field.

Copyrights © 2025






Journal Info

Abbrev

bits

Publisher

Subject

Computer Science & IT

Description

Building of Informatics, Technology and Science (BITS) is an open access media in publishing scientific articles that contain the results of research in information technology and computers. Paper that enters this journal will be checked for plagiarism and peer-rewiew first to maintain its quality. ...