Performance Comparison of Naive Bayes, Decision Tree, and Random Forest for Heart Disease Prediction

Authors

  • Eko Rian Sri Raharjo Dinas Komunikasi dan Informatika Kabupaten Klaten

Keywords:

heart disease prediction , machine learning, Naive bayes, decision tree, random forest , model evaluation

Abstract

Abstract— Medical datasets, when analyzed with suitable machine learning techniques, can improve the timeliness and consistency of disease prediction. In this study Naive Bayes, Decision Tree and Random Forest are compared using a heart disease dataset with 270 patients records and 14 attributes which is publicly available. The experiment consisted of identifying variables, assessing the quality of data, transforming target labels, 80:20 train-test split, training the model in Python and evaluation using accuracy, precision, recall, F1-score, Area Under the Curve (AUC), confusion matrix, and computation time. The results reveal that Naive Bayes obtained the best overall performance with an accuracy of 90.74%, precision of 94.44%, recall of 80.95%, F1-score of 87.18% and AUC of 0.925. Random Forest was second with an accuracy of 79.63% and an AUC of 0.885 while Decision Tree had an accuracy of 68.52% and an AUC of 0.690. Naive Bayes needed the least amount of time for training and prediction. According to these results, the Naive Bayes is the best and most efficient model for this dataset, but more testing on bigger datasets and cross validation are required to increase the model generalization.

Downloads

Download data is not yet available.

Downloads

Published

2026-07-20

How to Cite

Raharjo, E. R. S. (2026). Performance Comparison of Naive Bayes, Decision Tree, and Random Forest for Heart Disease Prediction. SAKA Journal of Applied Artificial Intelligence, 1(1), 14–18. Retrieved from https://jurnal.usahidsolo.ac.id/index.php/jaai/article/view/2349