Analysis of Accuracy Metric of Machine Learning Algorithms in Predicting Heart Disease

Sajad Yousefi, Maryam Poornajaf



Introduction: Heart disease is, for the most part, alluding to conditions that include limited or blocked veins that can prompt a heart attack, chest torment or stroke. Earlier identification of heart disease may reduce the death rate. The cost of medical diagnosis makes it perverse to cure it for the large amount of people early. Using machine learning models performed on dataset. This article aims to find the most efficient and accurate machine learning models for disease prediction.

Material and Methods: Several supervised machine learning algorithms were utilized to diagnosis and prediction of heart disease such as logistic regression, decision tree, random forest and KNN. The algorithms are applied to a dataset taken from the Kaggle site including 70000 samples.  In algorithms, methods such as the importance of features, hold out validation, 10-fold cross-validation, stratified 10-fold cross-validation, leave one out cross-validation are the result of effective performance and increase accuracy. In addition, feature importance scores was estimated for each feature in some algorithms. These features were ranked based on feature importance score. All the work is done in the Anaconda environment based on python programming language and Scikit-learn library.

Results: The algorithms performance is compared to each other so that performance based on ROC curve and some criteria such as accuracy, precision, sensitivity and F1 score were evaluated for each model. As a result of evaluation, random forest algorithm with F1 score 92%, accuracy 92% and AUC ROC 95%, has better performance than other algorithms.

Conclusion: The area under the ROC curve and evaluating criteria related to a number of classifying algorithms of machine learning to evaluate heart disease and indeed, the diagnosis and prediction of heart disease is compared to determine the most appropriate classifier.


F1-Score; Machine Learning; Heart Disease; Classification; Importance Score; Accuracy


Dwivedi AK. Performance evaluation of different machine learning techniques for prediction of heart disease. Neural Computing and Applications. 2018; 29(10): 685-93.

Hasan R. Comparative analysis of machine learning algorithms for heart disease prediction. ITM Web of Conferences. EDP Sciences; 2021.

Aradhana S, Jankisharan P, Virendra SK, Ashish M. Cardiovascular diseases prediction using various machine learning techniques. IOP Conference Series: Materials Science and Engineering. IOP Publishing; 2021.

Soni J, Ansari U, Sharma D, Soni S. Predictive data mining for medical diagnosis: An overview of heart disease prediction. International Journal of Computer Applications. 2011; 17(8): 43-8.

Li L, Wu Y, Ye M. Experimental comparisons of multi-class classifiers. Informatica. 2015; 39(1): 71-85.

Vaghela C, Bhatt N, Mistry D. A survey on various classification techniques for clinical decision support system. International Journal of Computer Applications. 2015; 116(23): 11-7.

Ali J, Khan R, Ahmad N, Maqsood I. Random forests and decision trees. International Journal of Computer Science Issues. 2012; 9(5): 272.

Imandoust SB, Bolandraftar M. Application of k-nearest neighbor (KNN) approach for predicting economic events: Theoretical background. International Journal of Engineering Research and Applications. 2013; 3(5): 605-10.

Baranidharan B, Pal A, Muruganandam P. Cardiovascular disease prediction based on ensemble technique enhanced using extra tree classifier for feature selection. International Journal of Recent Technology and Engineering. 2019; 8(3): 3236-42.

Sayadi M, Varadarajan V, Sadoughi F, Chopannejad S, Langarizadeh M. A machine learning model for detection of coronary artery disease using noninvasive clinical parameters. Life. 2022; 12(11): 1933.

Kwon K, Kim D, Park H. A parallel MR imaging method using multilayer perceptron. Med Phys. 2017; 44(12): 6209-24. PMID: 28944971 DOI: 10.1002/mp.12600

Tajmiri S, Azimi E, Hosseini MR, Azimi Y. Evolving multilayer perceptron, and factorial design for modelling and optimization of dye decomposition by bio-synthetized nano CdS-diatomite composite. Environ Res. 2020; 182: 108997. PMID: 31835116 DOI: 10.1016/j.envres.2019.108997

Azimi Y. Prediction of seismic wave intensity generated by bench blasting using intelligence committee machines. International Journal of Engineering. 2019; 32(4): 617-27.

Stochastic gradient descent [Internet]. 2004 [cited: 22 Nov 2022]. Available from:

Alalawi HH, Alsuwat MS. Detection of cardiovascular disease using machine learning classification models. International Journal of Engineering Research & Technology. 2021; 10(7): 151-7.

Chowdhury MN, Ahmed E, Siddik MA, Zaman AU. Heart disease prognosis using machine learning classification techniques. International Conference for Convergence in Technology. IEEE; 2021.

Ali MM, Paul BK, Ahmed K, Bui FM, Quinn JM, Moni MA. Heart disease prediction using supervised machine learning algorithms: Performance analysis and comparison. Comput Biol Med. 2021; 136: 104672. PMID: 34315030 DOI: 10.1016/j.compbiomed.2021.104672

Yousefi S. Comparison of the performance of machine learning algorithms in predicting heart disease. Frontiers in Health Informatics. 2021; 10(1): 99.

Dinesh KG, Arumugaraj K, Santhosh KD, Mareeswari V. Prediction of cardiovascular disease using machine learning algorithms. International Conference on Current Trends towards Converging Technologies. IEEE; 2018.

Sultana M, Haider A, Uddin M. Analysis of data mining techniques for heart disease prediction. International Conference on Electrical Engineering and Information Communication Technology. IEEE; 2016.

Ali M, Khan MD, Imran MA, Siddiki M. Heart disease prediction using machine learning algorithms [PhD Thesis]. BRAC University; 2019.

Bhanot K. Predicting presence of heart diseases using machine learning [Internet]. 2019 [cited: 2 Nov 2020]. Available from: https://

Yadav R, Singh U. Survey on heart disease prediction by using machine learning technique. International Journal of Creative Research Thoughts. 2019; 7(1): 44-51.

Shah D, Patel S, Bharti SK. Heart disease prediction using machine learning techniques. SN Computer Science. 2020; 1(6): 1-6.

Singh A, Kumar R. Heart disease prediction using machine learning algorithms. International Conference on Electrical and Electronics Engineering. IEEE; 2020.

Pushkala V, Agalya T, Angayarkanni SA. Comparative study of heart disease prediction using machine learning algorithms. International Journal of Innovations in Engineering and Technology. 2019; 12(4): 64-8.

Jan M, Awan AA, Khalid MS, Nisar S. Ensemble approach for developing a smart heart disease prediction system using classification algorithms. Research Reports in Clinical Cardiology. 2018; 9: 33-45.

Li JP, Haq AU, Din SU, Khan J, Khan A, Saboor A. Heart disease identification method using machine learning classification in e-healthcare. IEEE Access. 2020; 8: 107562-82.

Mohan S, Thirumalai C, Srivastava G. Effective heart disease prediction using hybrid machine learning techniques. IEEE Access. 2019; 7: 81542-54.

Beyene C, Kamat P. Survey on prediction and analysis the occurrence of heart disease using data mining techniques. International Journal of Pure and Applied Mathematics. 2018; 118(8): 165-74.

Kavitha BS, Siddappa M. A survey on machine learning techniques to predict heart disease. International Journal of Computer Science & Communication. 2020; 11(Special Issue): 48-53.

Kumar NK, Sindhu GS, Prashanthi DK, Sulthana AS. Analysis and prediction of cardio vascular disease using machine learning classifiers. International Conference on Advanced Computing and Communication Systems. IEEE; 2020.

Gavhane A, Kokkula G, Pandya I, Devadkar K. Prediction of heart disease using machine learning. International Conference on Electronics, Communication and Aerospace Technology. IEEE; 2018.

Kathiresan S. Analysis on cardiovascular disease classification using machine learning framework. ICTACT Journal on Data Science and Machine Learning. 2020; 2(1): 153-6.

Sharma H, Rizvi MA. Prediction of heart disease using machine learning algorithms: A survey. International Journal on Recent and Innovation Trends in Computing and Communication. 2017; 5(8): 99-104.



  • There are currently no refbacks.