DOI: 10.3390/jpm16080423 ISSN: 2075-4426

An Optimized and Explainable Machine Learning Framework for Diabetes Prediction Using Marine Predators Algorithm and SHAP

Alifa Nasrin, Muhammad Bin Asif, Ramasamy Naidu, Afzal Haq Asif, Muhammad Shahzad Chohan, Gausal Azam Khan, Md Arifuzzaman, Akm Azad, Muhammad Ali Martuza

Background: Diabetes mellitus affects over 500 million people worldwide, yet many machine learning prediction models remain difficult to interpret, limiting their clinical applicability. This study proposes an explainable machine learning framework integrating the Marine Predators Algorithm (MPA) for hyperparameter optimization with SHAP-based explainability to diabetes prediction. Methods: Logistic Regression (LR), Random Forest (RF), and MPA-optimized XGBoost were evaluated using a publicly available Kaggle diabetes dataset of approximately 100,000 records. Statistical significance was assessed using Wilcoxon signed-rank tests with Bonferroni correction for fold-wise cross-validation results, while McNemar’s and DeLong’s tests were employed for paired comparison of independent test-set predictions and ROC-AUC values, respectively. Performance was assessed using accuracy, precision, recall, F1-score, specificity, ROC-AUC, and Brier score. SHAP was used to provide global and local model explanations. Results: The MPA-optimized XGBoost model achieved the highest performance, with 96.72% accuracy, 97.70% precision, 95.70% recall, 96.71% F1-score, and 99.56% ROC-AUC, significantly outperforming LR and RF (p < 0.001). The model demonstrated good calibration with a Brier score of 0.0262. SHAP analysis identified HbA1c level, blood glucose level, and age as the most influential predictors, while interaction analysis indicated a synergistic relationship between HbA1c and blood glucose. Conclusions: The proposed framework demonstrated strong predictive performance and interpretable model behavior on the publicly available diabetes dataset used in this study. These findings indicate the potential of MPA-based optimization combined with SHAP explainability for supporting transparent machine learning research in diabetes prediction. However, additional external validation using independent clinical datasets is required before considering the framework for clinical decision support or real-world deployment.

More from our Archive