The high mortality rate caused by disorders of the cardiovascular system highlights the need for accurate early detection methods to support medical decision-making. This study aims to develop and evaluate a heart disease classification model using the K-Nearest Neighbor (KNN) algorithm optimized with Particle Swarm Optimization (PSO). In its implementation, the KNN algorithm employs the Manhattan distance parameter to measure the similarity between data instances. The dataset used in this study is a secondary heart disease dataset consisting of 302 records after preprocessing. The preprocessing stage includes data cleaning, numerical feature standardization using StandardScaler, and correlation-based feature selection to identify attributes that have significant relationships with the target variable. Model evaluation is conducted using a 10-fold cross-validation scheme and assessed using accuracy, precision, recall, and F1-score. The experimental results show that the baseline KNN model achieves an accuracy of 81.16%, while the PSO-optimized KNN model demonstrates improved performance with an accuracy of 82.81%, precision of 79.02%, recall of 92.13%, and an F1-score of 84.84%. These findings indicate that the application of PSO effectively enhances the performance and stability of the KNN algorithm in heart disease classification.
Copyrights © 2026