Heart Disease Risk Prediction via Feature Engineering and Stacking Ensembles
Abstract
Cardiovascular diseases (CVD) cause many deaths in the world. Heart disease is one important type of CVD. Classical tools such as the Framingham Risk Score use only a few variables and a simple linear form, so they cannot show complicated links between many risk factors. Electronic medical records are now very common, and machine-learning methods give another way to build risk prediction models from this data. This study uses the UCI Heart Disease (Cleveland) dataset to build a heart disease risk prediction method that puts feature engineering together with a stacking ensemble. It start from 14 clinical variables and design five enhanced features and three new composite features from blood pressure, cholesterol, ST depression, chest pain type, and exercise-induced angina. Logistic regression (LG), random forest (RF), XGBoost, support vector machine (SVM), and k-nearest neighbours (KNN) are used as base models in a two-layer stacking structure. It judges model performance with AUC, accuracy, precision, recall, and F1-score. The results show that the engineered features give small but clear improvements for most base models, and the stacking model has the best performance with a test AUC of 0.8771. Under a small sample size, the method keeps good accuracy and stability, and may be a useful tool for early screening of high-risk groups.
References
- World Health Organization. (2023). Cardiovascular diseases (CVDs) – fact sheet. World Health Organization. https: //www.who.int/news-room/fact-sheets/detail/cardiovascular-diseases-(cvds)
- Mensah, G. A., Roth, G. A., Fuster, V., et al. (2023). Global burden of cardiovascular diseases and risks, 1990–2021. Journal of the American College of Cardiology, 82(13), 1159–1205.
- D’Agostino, R. B., Sr., Vasan, R. S., Pencina, M. J., et al. (2008). General cardiovascular risk profile for use in primary care: The Framingham Heart Study. Circulation, 117(6), 743–753.
- Chicco, D., & Jurman, G. (2020). Machine learning can predict survival of patients with heart failure from serum creatinine and ejection fraction alone. BMC Medical Informatics and Decision Making, 20(1), 16.
- Quer, G., Arnaout, R., Henne, M., & Rao, P. (2021). Machine learning and the future of cardiovascular care: A state-of-the-art review. Journal of the American College of Cardiology, 77(3), 300–313.
- Krittanawong, C., Virk, H. U. H., Bangalore, S., et al. (2020). Machine learning prediction in cardiovascular diseases: A meta-analysis. Scientific Reports, 10(1), 16057.
- Dua, D., & Graff, C. (2019). Heart disease (Cleveland) data set. UCI Machine Learning Repository.
- Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5–32. https: //doi.org/10.1023/A: 1010933404324
- Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 785–794).
- Wolpert, D. H. (1992). Stacked generalization. Neural Networks, 5(2), 241–259. https: //doi.org/10.1016/S0893-6080(05)80023-1
- Kuhn, M., & Johnson, K. (2020). Feature engineering and selection: A practical approach for predictive models. CRC Press.
- Roe, K. D., Jawa, V., Zhang, X., & Overby Taylor, C. (2020). Feature engineering with clinical expert knowledge: A case study assessment of machine learning model complexity and performance. PLOS ONE, 15(4), e0231300.
- Saito, T., & Rehmsmeier, M. (2015). The precision–recall plot is more informative than the ROC plot when evaluating binary classifiers on imbalanced datasets. PLOS ONE, 10(3), e0118432.
- Yadav, D., Rani, D., & Verma, O. P. (2025). Impact of feature selection and feature engineering in prediction of cardiovascular diseases. Computers in Biology and Medicine, 197(Pt B), 111027.
- Bilal, A., Alzahrani, A., Almohammadi, K., Saleem, M., Farooq, M. S., & Sarwar, R. (2025). Explainable AI-driven intelligent system for precision forecasting in cardiovascular disease. Frontiers in Medicine, 12, 1596335.
- Molnar, C. (2022). Interpretable machine learning: A guide for making black box models explainable (2nd ed.). Self-published. https: //christophm.github.io/interpretable-ml-book
- Chen, Y., Zhang, J., & Qin, X. (2022). Interpretable instance disease prediction based on causal feature selection and effect analysis. BMC Medical Informatics and Decision Making, 22(1), 51.