Comparative Analysis of Naive Bayes, K-Nearest Neighbors (KNN), and Support Vector Machine (SVM) Algorithms for Classification of Heart Disease Patients


  • Aina Damayunita Department of Information Systems, STMIK LIKMI, Indonesia
  • Rifqi Syamsul Fuadi Department of Information Systems, STMIK LIKMI, Indonesia
  • Christina Juliane Department of Information Systems, STMIK LIKMI, Indonesia



Classification algorithms, Heart disease, K-Nearest Neighbors (KNN), Naive Bayes, Support Vector Machine (SVM)


Heart disease is still the leading cause of death. In this study, we tried to test several factors that can identify patients with heart disease using 3 classification algorithms: Naive Bayes, K-Nearest Neighbors (KNN), and Support Vector Machine (SVM).  The purpose of this study is to find out which algorithm can produce the highest accuracy in classifying, analyzing, and obtaining confusion matrix values along with the accuracy of predicting heart disease based on several factors or other comorbidities that the patient has, ranging from BMI to the patient's skin cancer status.  From the results of trials conducted by the SVM algorithm, it has the highest accuracy value, which is 92% while the Naive Bayes algorithm is the lowest with an accuracy value of 88%.


C. W. Tsao et al., “Heart Disease and Stroke Statistics-2022 Update: A Report From the American Heart Association,†Circulation, vol. 145, no. 8, pp. e153–e639, Feb. 2022.

“Global atlas on cardiovascular disease prevention and control.†[Online]. Available: [Accessed: 31-Jul-2022].

M. Allahyari et al., “Text Summarization Techniques : A Brief Survey,†2017.

S. Ghwanmeh, A. Mohammad, and A. Al-Ibrahim, “Innovative Artificial Neural Networks-Based Decision Support System for Heart Diseases Diagnosis,†J. Intell. Learn. Syst. Appl., vol. 05, no. 03, pp. 176–183, 2013.

Q. Kadhim Al-Shayea, “Artificial Neural Networks in Medical Diagnosis,†IJCSI Int. J. Comput. Sci. Issues, vol. 8, no. 2, 2011.

P. Ghosh et al., “Efficient prediction of cardiovascular disease using machine learning algorithms with relief and lasso feature selection techniques,†IEEE Access, vol. 9, pp. 19304–19326, 2021.

A. Rufai, U. S., and M. Umar, “Using Artificial Neural Networks to Diagnose Heart Disease,†Int. J. Comput. Appl., vol. 182, no. 19, pp. 1–6, Oct. 2018.

D. A. Firdlous, “Komparasi Algoritma Klasifikasi Data Mining untuk Memprediksi Penyakit Jantung,†Infoman’s J. Ilmu-ilmu Manaj. dan Inform., vol. 16, no. 1, pp. 79–84, May 2022.

K. Pahwa and R. Kumar, “Prediction of heart disease using hybrid technique for selecting features,†2017 4th IEEE Uttar Pradesh Sect. Int. Conf. Electr. Comput. Electron. UPCON 2017, vol. 2018-January, pp. 500–504, Jun. 2017.

S. Pouriyeh, S. Vahid, G. Sannino, G. De Pietro, H. Arabnia, and J. Gutierrez, “A comprehensive investigation and comparison of Machine Learning Techniques in the domain of heart disease,†Proc. - IEEE Symp. Comput. Commun., pp. 204–207, Sep. 2017.

A. Fadlli and M. I. Rosadi, “Klasifikasi Penyakit Jantung Koroner Menggunakan Seleksi Fitur Dan Support Vector Machine,†Explor. IT J. Keilmuan dan Apl. Tek. Inform., vol. 10, no. 2, pp. 32–41, 2018.

“Klasifikasi K-Nearest Neighbors (KNN) Menggunakan Python | by ERZYLIA HERLIN BRILIANT | Medium.†[Online]. Available: [Accessed: 21-Jul-2022].

M. Fairuzabdi, “Konsep Dasar Data, Informasi & Pengetahuan - FairuzelsaidFairuzelsaid,†2020. [Online]. Available: [Accessed: 20-Jul-2022].

“Naive Bayes Classifier Tutorial: with Python Scikit-learn | DataCamp.†[Online]. Available: [Accessed: 21-Jul-2022].

M. Awad and R. Khanna, “Support Vector Machines for Classification,†Effic. Learn. Mach., pp. 39–66, 2015.

M. T., D. Mukherji, N. Padalia, and A. Naidu, “A Heart Disease Prediction Model using SVM-Decision Trees-Logistic Regression (SDL),†Int. J. Comput. Appl., vol. 68, no. 16, pp. 11–15, Apr. 2013.

“Scikit-learn SVM Tutorial with Python (Support Vector Machines) | DataCamp.†[Online]. Available: [Accessed: 29-Jul-2022].

“Support Vector Machine Classification with Python | by Kurnia Sari Pratiwi | Medium.†[Online]. Available: [Accessed: 29-Jul-2022].

D. for H. D. and S. P. National Center for Chronic Disease Prevention and Health Promotion, “Heart Disease Facts |,†2022. [Online]. Available: [Accessed: 26-Jul-2022].

J. Xu, Y. Zhang, and D. Miao, “Three-way confusion matrix for classification: A measure driven view,†Inf. Sci. (Ny)., vol. 507, pp. 772–794, Jan. 2020.







Citation Check