Machine Learning-Based Stacked Ensemble Models for Predicting Heart Disease
Abstract
Heart disease is still the leading cause of mortality worldwide. Hence, advanced prediction models are necessary for early detection and care. By combining three base classifiers—K-Nearest Neighbors (KNN), Support Vector Machines (SVMs), and Random Forests (RFs)—with logistic regression as a meta-model, this work suggests a stacked ensemble model to increase the accuracy of heart disease prediction. Specifically, this paper utilizes KNN to capture local data patterns. Secondly, SVM deals with high-dimensional feature spaces, and RF is utilized to mitigate overfitting through ensemble voting. Logistic regression is used to weight its predictions optimally. The model was trained and tested on the UCI Heart Disease dataset (303 records, 14 clinical features). This paper's preprocessing stage deals with missing values, normalizes numerical data, and codes categorical variables. To optimize the performance, the study also performs hyperparameter tuning and cross-validation. According to the experimental data, the stacked ensemble outperforms a single model (KNN: 85.2%; SVM: 88.6%; RF: 89.3%) with an accuracy of 93.7%. Key risk factors identified included maximum heart rate, cholesterol level, and type of chest pain. Consistency with clinical knowledge validated the reliability of the model. This study highlights how effective ensemble learning is at increasing diagnostic precision, and it shows promise for use in clinical decision support systems. Future work will explore further integrating genetic and lifestyle data and deployment in real-time healthcare environments to improve predictive robustness and patient outcomes.
References
- Soni, J., Ansari, U., Sharma, D., & Soni, S. (2011). Predictive data mining for medical diagnosis: An overview of heart disease prediction. International Journal of Computer Applications, 17(8), 43-48.
- Jindal, H., Sharma, S., Vig, R., & Kumar, M. (2021). Heart disease prediction using machine learning algorithms. IOP Conference Series: Materials Science and Engineering, 1022(1), 012072.
- Biswas, N., Ali, M. M., Rahaman, M. A., Islam, M., Mia, M. R., Azam, S., Ahmed, K., Bui, F. M., Al-Zahrani, F. A., & Moni, M. A. (2023). Machine learning-based model to predict heart disease in early stage employing different feature selection techniques. Computational and Mathematical Methods in Medicine, 2023, 6864343.
- Rahman, A.U., Alsenani, Y., Zafar, A. et al. (2024). Enhancing heart disease prediction using a self-attention-based transformer model. Sci Rep 14, 514.
- Patel, J., Upadhyay, T., & Patel, S. (2016). Heart disease prediction using machine learning and data mining technique. International Journal of Computer Science and Communication, 136(11), 129-137.
- Singh, P., Singh, S., & Pandi-Jain, G. S. (2018). Effective heart disease prediction system using data mining techniques. International Journal of Nanomedicine, 13(sup1), 121–124.
- Janosi, A., Steinbrunn, W., Pfisterer, M., & Detrano, R. (1989). Heart Disease [Dataset]. UCI Machine Learning Repository. Retrieved from https://doi.org/10.24432/C52P4X.
- Indrakumari, R., Poongodi, T., & Jena, S. R. (2022). Heart disease prediction using exploratory data analysis. Procedia Computer Science, 173, 130–139.