Application of the K-Nearest Neighbor (KNN) Algorithm in Data Mining for Heart Disease Prediction - Nur Aida (COREAI: Jurnal Kecerdasan Buatan, Komputasi dan Teknologi Informasi, 2026)
Cardiovascular (heart) disease is a leading cause of high global mortality rates. This is often exacerbated by low public awareness and limited access to cardiac screening facilities. To address these challenges, this study aims to apply the K-Nearest Neighbors (KNN) algorithm to classify heart disease and evaluate the resulting accuracy. The KNN algorithm was selected for its efficiency and ease of use in classifying large datasets; it works by measuring the distance between objects using the Euclidean distance formula. This classification model was built using RapidMiner 9.10 software. The data used was sourced from the Cleveland UCI Machine Learning Repository database available via Kaggle, consisting of a total of 303 patient records and characterized by 14 features used for prediction. The target variable (heart disease) was set as the classification label. Test results using cross-validation demonstrated that the KNN implementation is effective for predicting heart disease. This model achieved an accuracy of 64.03% with the parameter setting K=5. Further analysis of the confusion matrix identified 124 true-positive patients, with a maximum precision of 64.58%. Overall, these accuracy results confirm the potential and capability of the KNN method in classifying diagnostic data for heart disease patients.