Digital Health
Hybrid data balancing and ensemble learning with SHAP-based explainability to predict cardiovascular disease using a unified dataset
By Khandaker Mohammad Mohi Uddin, Abdullah and Chowdhury Mohammad Rakin Haider.
Abstract
Objectives Heart disease is currently one of the most serious diseases, contributing to a large share of patient deaths. Diagnosing it is a challenging procedure that needs to be done both quickly and accurately. Methods This research introduces a practical machine learning framework aimed at improving heart disease prediction using multiple datasets. To build a more reliable model, three separate datasets were first combined into a single, enriched source of data. Since the data was imbalanced, a hybrid balancing technique using the Instance Hardness Threshold (IHT) and Tomek Links was applied to ensure fairer learning across classes. All preprocessing (scaling, balancing, hyperparameter tuning) was done exclusively within the training set of each fold in stratified 5-fold cross validation, with the hyperparameter tuning further embedded in an inner 3-fold cross validation. A total of 12 machine learning models were trained and compared, with the top-performing models ensembled using soft- and hard-voting. Results The most successful model, a soft voting combination of XGBoost, Extra Trees, Random Forest, MLP and Decision Tree, outperformed the others with an accuracy of 96.02% (95% CI: 95.47 – 96.56%) with a precision of 97.83% and a recall of 94.37% using the fold-wise protocol designed to prevent preprocessing leakage. In addition to accuracy, calibration analysis and clinical decision-curve analysis showed that the model’s predicted probabilities are suitable for a clinical context, and a sensitivity–specificity analysis revealed an optimal decision threshold of 0.323. Finally, SHAP was applied to clarify the impact of each feature; chest pain type and thalassemia status were found to be the most influential predictors. Conclusion The proposed ensemble model, based on a hybrid-balanced SHAP interpretable model holds great promise for clinical applications and transparency in heart disease prediction.







