Diabetes mellitus is a chronic disease with serious implications for global health. Early detection is essential to reduce these risks, and machine learning methods are widely used in diabetes prediction. However, improving accuracy remains a major challenge in the development of predictive models. This study proposes a stacking-based ensemble learning approach with an out-of-fold (OOF) scheme to improve classification performance. The proposed method consists of several systematic steps, namely (1) data preprocessing via median imputation of invalid values and feature transformation according to model characteristics, (2) the creation of base learners comprising Logistic Regression, Gaussian Naïve Bayes, Support Vector Machine, Random Forest, and XGBoost, (3) model training using Stratified Cross Validation 5 Fold to generate OOF predictions, (4) combining all OOF predictions into a meta-feature matrix, and (5) training an XGBoost-based meta-model to generate the final prediction. This approach enables the meta-model to optimally learn the relationships among the outputs of the baseline models. Experimental results show that the proposed method achieves an accuracy of 91.15%, precision of 90.65%, recall of 83.21%, and an F1-score of 86.77%. These results indicate that stacking is effective in improving the accuracy of diabetes predictions.
Copyrights © 2026