Classification of Heart Disease Based on Clinical Data Using the K-Nearest Neighbor Method - Muhajir, Abdullah; Cendra Harmon (Jurnal Inotera, 2026)
Heart disease is one of the leading causes of death worldwide; therefore, methods that can support early and accurate diagnosis are urgently needed. This study aims to classify heart disease based on patients’ clinical data using the K-Nearest Neighbor (KNN) method. The dataset used consists of patients’ clinical data, including attributes such as age, gender, blood pressure, cholesterol levels, maximum heart rate, and other medical attributes.The research stages include data preprocessing, transformation of categorical data into numerical form, data normalization using StandardScaler, and data splitting into training and testing sets with a ratio of 80% and 20%, respectively. The classification process is carried out using the K-Nearest Neighbor algorithm with a K value of 7. Model performance evaluation is conducted using a confusion matrix and evaluation metrics including precision, recall, f1-score, and accuracy.The results show that the KNN method is able to classify heart disease with an accuracy rate of 57%. The model demonstrates good performance on the majority class; however, its performance on the minority class remains low due to data imbalance and similarities in characteristics between classes. Therefore, the KNN method can be used as an initial approach for classifying heart disease based on clinical data, although further development is still required to improve model performance