Stacked ensemble model with explainable AI for early detection of heart disease
Document Type
Article
Publication Date
6-1-2026
Abstract
Heart disease (HD) is still one of the most common causes of death around the world. Early detection is very important, but it is often hard to do because the symptoms are not specific and the models are not very clear. We propose a two-layer stacked ensemble that combines four base learners—Support Vector Machine, K-Nearest Neighbors, Naïve Bayes, and Decision Tree—with Logistic Regression as a meta-learner. This ensemble was trained on a balanced sample from five public HD datasets. The model outperforms standard baselines with 93.69% accuracy, 93% F1-score, and 94.7% AUC. To ensure that predictions are clinically interpretable, we offer global explainability through SHAP summaries, feature importance, and stacked plots, as well as ELi5 permutation–importance plots. Both identify ST slope and chest pain type as the most significant predictors, consistent with clinical understanding. We use LIME, ELi5 text explanations, SHAP force plots, and waterfall plots to illustrate how different features of a person affect their risk. We utilize SHAP interaction values to examine feature interactions and confirm nonlinear relationships using 1D and 2D partial-dependence plots. Finally, we generate counterfactual explanations to demonstrate minor, plausible changes based on domain knowledge that would affect a prediction. This is useful both for auditability and for conversations around patient-centred care. The framework combines global and local explainable artificial intelligence with strong predictive power to improve decision support and accuracy in HD risk assessment.
Keywords
Ensemble model, explainability, explainable artificial intelligence, heart disease, machine learning
Publication Title
Analytical Science Advances
ISSN
2628-5452
DOI
10.1002/ansa.70072
Recommended Citation
Nahar, Nazmun; Siam, Sanjatul Hasan; Bhowmik, Joy; Ripa, Ayesha Nasrin; Imam, Md Hasan; Woo, Haw Jiunn; Osman, Hamid; Khandaker, Mayeen Uddin; and Ahmed, Shams Forruque, "Stacked ensemble model with explainable AI for early detection of heart disease" (2026). Research Publications (2026 to 2030). 623.
https://knova.um.edu.my/research_publications_2026_2030/623
Volume
7
Issue
1