Irrelevant attributes often degrade the effectiveness of distance-based algorithms like K-Nearest Neighbors (KNN) in heart disease prediction. This study enhances a KNN model using Sequential Forward Selection (SFS) on the Cleveland dataset to optimize computational efficiency and precision while maintaining stable recall. To rigorously prevent data leakage, data partitioning was executed prior to mode imputation and normalization, followed by feature selection within a 5-fold stratified cross-validation framework. To further guarantee model robustness and rule out arbitrary selection, a 5-repeated 10-fold cross-validation and a 50-iteration feature stability analysis were executed. Compared to a baseline model (k=7, Euclidean; 80.33% accuracy) utilizing all 13 original attributes, the optimal 7-feature subset (cp, trestbps, chol, thalach, oldpeak, ca, thal) reduced the dimensional space by 46% and achieved 81.97% Accuracy, 77.42% Precision, 85.71% Recall, 78.79% Specificity, 0.9183 ROC-AUC, and an 81.36% F1-Score on an independent hold-out test set comprising 61 samples. Although McNemar's test (p = 1.0000) indicated the absolute accuracy improvement was not statistically significant, the 7-feature model successfully eliminated unstable features and reduced statistical noise. Ultimately, applying SFS provides a highly efficient, computationally lightweight framework for heart disease prediction without compromising predictive reliability.
Copyrights © 2026