Heart Disease Prediction Using KNN, Decision Tree, and Naïve Bayes - Baik Budi (Electrical Engineering Department Faculty of Engineering Universitas Andalas, 2026)
Cardiovascular Disease (CVD) remains a leading global cause of mortality, making early and accurate diagnosis critical for effective medical intervention. Machine Learning (ML) algorithms offer promising solutions for automating clinical decision support systems. This study compares three supervised learning algorithms—K-Nearest Neighbors (KNN), Decision Tree (DT), and Naive Bayes (NB)—to evaluate their diagnostic efficacy in predicting heart disease. The models were trained and tested using a clinical dataset of 205 instances (100 normal and 105 heart disease cases) with an 80:20 data split. Performance was evaluated based on Accuracy, Precision, Recall, and F1-Score derived from confusion matrices. The experimental results demonstrate that the Decision Tree algorithm achieved the highest aggregate accuracy of 98.54%, exhibiting exceptional clinical reliability with a perfect precision score (zero false positives) and high sensitivity (only three false negatives). The KNN model performed comparably well, achieving 98.05% accuracy and zero false positives. In contrast, the Naive Bayes algorithm underperformed, with 82.93% accuracy and high rates of both Type I and Type II errors. In conclusion, the Decision Tree model emerges as the most robust, precise, and safe algorithmic architecture for clinical implementation in heart disease screening, effectively minimizing both false alarms and missed diagnoses.