Performance Comparison of Machine Learning Algorithms in Heart Disease Prediction with Enhanced Accuracy through Hyper parameter Tuning

Authors

  • Nisreen Ryadh Hamza Computer Science Department, College of Computer Science and Information Technology, University of Al –Qadisiyah Al-Diwaniah, Iraq.
  • Farah Jawad Al-Ghanim Computer Science Department, College of Computer Science and Information Technology, University of Al –Qadisiyah Al-Diwaniah, Iraq.

DOI:

https://doi.org/10.29304/jqcsm.2025.17.22180

Keywords:

Heart Disease, Machine Learning, Decision Tree, Support Vector Machine

Abstract

     Heart disease, which frequently results from blockage of the coronary arteries, the blood channels that supply the heart with oxygen-rich blood, is still one of the top causes of death globally. Plaque and fatty deposits that accumulate along the arterial walls are the main causes of this blockage, which makes the arteries narrow and limits blood flow. Even with cardiac disorders' seriousness and potentially fatal consequences, early detection remains a significant challenge in the medical field, often due to the complex and subtle nature of early symptoms. This diagnostic difficulty highlights the need for advanced computational tools that can support clinical decision-making. In this context, this study investigates the application of machine learning algorithms to heart disease risk prediction. Five artificial intelligence models—Support Vector Machine (SVM), Random Forest (RF), K-Nearest Neighbors (KNN), Decision Tree (DT), and Naive Bayes (NB)—were tested on a dataset of 1,888 records and 14 attributes. In order to increase data quality and guarantee that models can learn patterns efficiently, preprocessing was used to clean and prepare the data first. This was followed by hyper parameter optimization for the SVM and KNN models. The aim of hyper parameter optimization is to maximize the model's performance on the data. With an accuracy of 96.30%, Random Forest outperformed the other models under evaluation. Decision Tree came in second with 95.59% , SVM with 94.55% ,KNN with 0.9425 and Naive Bayes with 0.6966 . These studies demonstrate how machine learning may be used to identify cardiac illness early on by identifying intricate patterns in data and providing more precise results than conventional techniques.

Downloads

Download data is not yet available.

References

National Cancer Institute. (n.d.). NCI dictionary of cancer terms. https://www.cancer.gov/publications/dictionaries/cancer-terms/def/coronary-heart-disease

Saboor, A., Khan, M. A., Alghamdi, N. S., & Almotiri, S. H. (2022). A method for improving prediction of human heart disease using machine learning algorithms. Mobile Information Systems, Hindawi. https://doi.org/10.1155/2022/4721354

Centers for Disease Control and Prevention. (2022, July 12). About heart disease. https://www.cdc.gov/heartdisease/about.htm

American Heart Association. (2023). Heart disease and stroke statistics - 2023 update. https://professional.heart.org/en/science-news/heart-disease-and-stroke-statistics-2023-update

Barla, N. (2022, July 21). Data science and machine learning in the medical industry. Neptune.ai. https://neptune.ai/blog/data-science-machine-learning-in-healthcare

Shestel, A. (2021, March 18). Python in healthcare. Belitsoft. https://belitsoft.com/python/python-in-healthcare

Shrestha, R., & Chatterjee, J. M. (2019). Heart disease prediction system using machine learning. LBEF Research Journal of Science, Technology and Management, 1(2).

Shah, D., Patel, S., & Bharti, S. K. (2020). Heart disease prediction using machine learning techniques. International Journal of Computer Applications, 1, Article 345.

Khedr, A. M., Al Aghbari, Z., Al Ali, A., & Eljamil, M. (2021). An efficient association rule mining from distributed medical databases for predicting heart diseases. IEEE. https://doi.org/10.1109/ACCESS.2021.3055203

Pal, M., Parija, S., Panda, G., Dhama, K., & Mohapatra, R. K. (2022). Risk prediction of cardiovascular disease using machine learning classifiers. Open Medicine (Warsaw), 17(1). https://doi.org/10.1515/med-2022-XXXX

Kiran, J., Debbarma, N., & Ganjala, S. (2023, April 26). Heart disease prediction using machine learning. Conference Paper.

Arora, D., Sharma, A., & Agrawal, B. K. (2024, April 30). Assessing the impact of various machine learning algorithms for heart disease prediction. Conference Paper.

Nazirkhan, F., & Rajiah, S. (2024). Heart disease prediction dataset. Kaggle. https://www.kaggle.com/datasets/mfarhaannazirkhan/heart-dataset/data

SmartDraw. (n.d.). Decision tree – Learn everything about decision trees. https://www.smartdraw.com/decision-tree

Webtunix Solutions. (n.d.). K-Nearest Neighbors Classifier. https://www.ris-ai.com/k-nearest-neighbors-classification

Gandhi, R. (2018, July 5). Support vector machine - Introduction to machine learning algorithms. Medium – Towards Data Science. https://towardsdatascience.com/support-vectormachine-introduction-to-machine-learning-algorithms-934a444fca47

Yiu, T. (2021, September 29). Understanding Random Forest. Medium – Towards Data Science. https://towardsdatascience.com/understanding-random-forest-58381e0602d2

Dimitoglou, G., Adams, J. A., & Jim, C. M. (n.d.). Comparison of the C4.5 and a Naïve Bayes classifier for the prediction of lung cancer survivability.

Downloads

Published

2025-06-30

How to Cite

Ryadh Hamza, N., & Jawad Al-Ghanim, F. (2025). Performance Comparison of Machine Learning Algorithms in Heart Disease Prediction with Enhanced Accuracy through Hyper parameter Tuning. Journal of Al-Qadisiyah for Computer Science and Mathematics, 17(2), Comp. 60–71. https://doi.org/10.29304/jqcsm.2025.17.22180

Issue

Section

Computer Articles