Implementation of K-Nearest Neighbour (KNN) Algorithm and Random Forest Algorithm in Identifying Diabetes - Diranisha, Virly; Agung Triayudi; Ratih Titi Komalasari (CV. Media Digital Publikasi Indonesia, 2024)
Diabetes, one of the noncommunicable diseases (NCDs), is currently a major health threat worldwide. So far, diabetes symptoms have only been diagnosed by people according to known physical characteristics without the support of factual evidence or other medical considerations. With the advancement of technology, it is possible to use algorithms to solve various kinds of problems. One of artificial intelligence (AI), machine learning, concentrates on creating systems that can learn from data. This research uses the K-Nearest Neighbor (KNN) and Random Forest algorithms that can be utilised as testing algorithms to identify diabetes. Classification is done based on training data that has been provided in the dataset. The purpose of this research is to determine the best classification in identifying diabetes with the K-Nearest Neighbor (KNN) algorithm and the Random Forest algorithm and is expected to provide more understanding of the implementation of machine learning models. comparing the two algorithms between the KNN algorithm and the Random Forest algorithm. By dividing the testing data and training data using a ratio of 20%: 80% randomised data 300 times. The results of the accuracy evaluation obtained from the Confusion Matrix show that the Random Forest Algorithm has the best accuracy value of 77%, Precision 89%, Recall 78% and F1-Score 83% with an estimator of 100 trees. While the KNN algorithm obtained accuracy of 73%, Precision 87%, Recall 73% and F1-Score 79% of the value of K = 7. Based on the comparison results of the two algorithms, it shows that the accuracy value obtained is greater than the Random Forest algorithm even though the value obtained is not much different.