Comparative Performance of Linear Regression and Machine Learning Models for Predicting Glycemic Status in Uncontrolled Type 2 Diabetes: SHAP-Based Analysis

preprint OA: closed CC-BY-4.0
📄 Open PDF Full text JSON View at publisher

Abstract

Abstract Background This study aimed to compare the predictive performance of linear regression (LR) versus other machine learning (ML) models and assess the importance of clinical, biochemical and medication adherence predictors using SHapley Additive exPlanations (SHAP) analysis. Methods A cross-sectional study was conducted among adults (≥ 18 years) with type 2 diabetes mellitus (T2DM) and uncontrolled glycated hemoglobin (HbA1c) (≥ 7%), which was the primary outcome. After data preprocessing and feature selection, four supervised regression models; LR, random forest (RF), support vector regression (SVR), and extreme gradient boosting (XGBoost), were trained and evaluated. ANOVA F-test identified the top predictive continuous variables and SHAP analysis was used for clinical interpretation. Results Data from 223 patients were analyzed (mean age: 57.4 ± 9.8 years; 50.7% female). LR achieved the highest coefficient of determination (R²=0.28), while RF had the lowest mean absolute error (MAE = 1.18). SVR and XGBoost underperformed, with R² values of 0.19 and 0.07, respectively. Key predictors for high HbA1c included; fasting blood glucose (FBG), diastolic blood pressure (DBP), body mass index (BMI), insulin dose, serum magnesium concentration, and medication adherence. SHAP analysis confirmed the influence of DBP, FBG, insulin dose, magnesium levels, and low adherence on elevated HbA1c. Conclusion Although RF model moderately predicted HbA1c, LR outperformed the other ML-models. SHAP analysis highlighted interpretable predictors, supporting the use of explainable ML models for personalized glycemic risk stratification and clinical decision-making in T2DM management. Future studies should consider larger, multi-center datasets with more features and external validation to enhance ML-models’ predication accuracy and generalizability.
Full text 81,360 characters · extracted from preprint-html · click to expand
Comparative Performance of Linear Regression and Machine Learning Models for Predicting Glycemic Status in Uncontrolled Type 2 Diabetes: SHAP-Based Analysis | Research Square window.SnipcartSettings = { analytics: { enabled: false } }; (function() { var accessVector = localStorage.getItem('access_vector') || ''; window.dataLayer = window.dataLayer || []; if (accessVector) { window.dataLayer.push({ user: { profile: { profileInfo: { snid: accessVector } } } }); } })(); (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K279D39R'); Browse Preprints In Review Journals COVID-19 Preprints AJE Video Bytes Research Tools Research Promotion AJE Professional Editing AJE Rubriq About Preprint Platform In Review Editorial Policies Our Team Advisory Board Help Center Sign In Submit a Preprint Cite Share Download PDF Research Article Comparative Performance of Linear Regression and Machine Learning Models for Predicting Glycemic Status in Uncontrolled Type 2 Diabetes: SHAP-Based Analysis Juhaina Salim Al-Maqbali, Ibrahim Al-Zakwani, Abdullah M. Al Alawi, and 1 more This is a preprint; it has not been peer reviewed by a journal. https://doi.org/ 10.21203/rs.3.rs-7292468/v1 This work is licensed under a CC BY 4.0 License Status: Posted Version 1 posted You are reading this latest preprint version Abstract Background This study aimed to compare the predictive performance of linear regression (LR) versus other machine learning (ML) models and assess the importance of clinical, biochemical and medication adherence predictors using SHapley Additive exPlanations (SHAP) analysis. Methods A cross-sectional study was conducted among adults (≥ 18 years) with type 2 diabetes mellitus (T2DM) and uncontrolled glycated hemoglobin (HbA1c) (≥ 7%), which was the primary outcome. After data preprocessing and feature selection, four supervised regression models; LR, random forest (RF), support vector regression (SVR), and extreme gradient boosting (XGBoost), were trained and evaluated. ANOVA F-test identified the top predictive continuous variables and SHAP analysis was used for clinical interpretation. Results Data from 223 patients were analyzed (mean age: 57.4 ± 9.8 years; 50.7% female). LR achieved the highest coefficient of determination (R²=0.28), while RF had the lowest mean absolute error (MAE = 1.18). SVR and XGBoost underperformed, with R² values of 0.19 and 0.07, respectively. Key predictors for high HbA1c included; fasting blood glucose (FBG), diastolic blood pressure (DBP), body mass index (BMI), insulin dose, serum magnesium concentration, and medication adherence. SHAP analysis confirmed the influence of DBP, FBG, insulin dose, magnesium levels, and low adherence on elevated HbA1c. Conclusion Although RF model moderately predicted HbA1c, LR outperformed the other ML-models. SHAP analysis highlighted interpretable predictors, supporting the use of explainable ML models for personalized glycemic risk stratification and clinical decision-making in T2DM management. Future studies should consider larger, multi-center datasets with more features and external validation to enhance ML-models’ predication accuracy and generalizability. Linear Regression Machine Learning Model Performance Diabetes Glycemic Control SHapley Additive exPlanations Figures Figure 1 Figure 2 Introduction The integration of machine learning (ML) in clinical prediction modeling has attracted considerable interest, particularly in the management of chronic conditions like type 2 diabetes mellitus (T2DM). The individualized risk prediction of T2DM patient could enhance outcomes and guide treatment decisions.(1) Among the most consistently identified predictors by ML models are baseline glycated hemoglobin (HbA1c) and fasting blood glucose (FBG) levels .(2, 3, 4) Other predictors include medication adherence, dietary habits, depression, body mass index (BMI), waist circumference, and disease duration.(2, 5, 6) Additionally, ML has also revealed emerging predictors such as negative emotions, urinary biomarkers, heart rate variability, and insulin resistance that may be especially relevant in certain patient subgroups.(5, 6, 7) Tree-based models such as random frost (RF) and gradient boosting machine such XGBoost, often outperform other algorithms in predictive accuracy, often achieving area under the curves (AUCs) above 0.80, indicating strong predictive performance.(2, 5, 7, 8) These models support early identification of high-risk patients and help guide individualized treatment, especially when handling non-linear relationships and/or high-dimensional data.(3, 7, 9, 10). Despite the increasing use of ML, logistic regression (LR) remains a widely used method, particularly for smaller datasets with linear associations and fewer feature sets (9, 11), consistently identifying key predictors such as FBG, HbA1c, BMI, age, lipid profiles, and diabetes duration.(3, 7, 9). It is characterized by ease of implementation and interpretability. (11). In contrast, ML models offer greater flexibility and accuracy in complex datasets and large-scale clinical applications.(3, 7, 9, 10) A landmark systematic review by Christodoulou et al. (2019) challenged the perceived superiority of ML models, reporting no consistent performance benefits of ML models over LR in clinical prediction tasks.(12) Although ML algorithms are capable of modelling complex nonlinear interactions across diverse data domains, their generalizability and reliability in outperforming traditional LR methods remains to be explored. This study aims to evaluate and compare the predictive performance of LR and ML models in estimating HbA1c levels among patients with uncontrolled T2DM using integrated clinical, biochemical, and medication adherence data. Moreover, the study employed Shapley Additive exPlanations (SHAP) to improve model interpretability, facilitate individualized risk stratification, and support data-driven clinical decision-making. Methods Study Design , Population and Setting This is a cross-sectional observational study included adult patients (≥18 years old) diagnosed with T2DM and having uncontrolled glycemic status, defined as HbA1c ≥7% based on the most recent reading in the last 6 months. The study was conducted at a tertiary care teaching hospital with referral services that provide specialized medical facilities like endocrinology. Informed consent to participate was obtained from all patients prior to their involvement in the study. For participants under the age of 16, consent was obtained from their parents or legal guardians in accordance with ethical guidelines. Outcome and Predictors The primary outcome was HbA1c level. Predictor variables included demographic characteristics: age, sex; clinical parameters: duration of diabetes mellitus, comorbidities (such as hypertension (HTN), dyslipidemia (DLP), and chronic kidney disease (CKD)); laboratory parameters (blood pressure (BP), fasting blood glucose (FBG), serum total magnesium (tMg) and serum ionized magnesium (iMg) concentrations; body mass index (BMI); medication data (metformin, sulfonylureas, DPP-4 inhibitors, SGLT2 inhibitors, and insulin doses); and adherence assessment which was stratified into high, medium, and low levels based on Morisky Medication Adherence Scale-8 (MMAS-8).(13, 14) The required permission for use of the scale and its coding was obtained through the licensed agreement with certification number 1350 (available from MMAR, LLC.,www.moriskyscale.com. , © 2007 Donald E. Morisky). Data Preprocessing and Modeling Records with any missing predictor values were excluded from the analysis. Continuous variables were standardized by z-scores; categorical variables were label-encoded. Feature selection was performed using the ANOVA F-test through the SelectKBest to identify the top predictive continuous variables. In addition, permutation importance was applied to the trained RF model to assess the relative importance of different features. Four supervised regression models were developed: LR to serve as a baseline comparator, RF to model nonlinear relationships and interactions, XGBoost for advanced tree-based boosting, and support vector regression (SVR) for handling high-dimensional and non-linear data with kernel functions.(8, 15) An 80/20 train-test split was used for initial model development. The ensemble method “voting regressor” was performed to reduce variance and bias by combining the strengths of multiple models (LR, RF, and XGBoost). Replication was performed independently and performance was evaluated using mean absolute percentage error (MAPE). The data analysis was conducted using Python version 3.12.7, provided by Anaconda, Inc., within a Jupyter Notebook environment. Model Evaluation and validation Model performance was assessed using 5-fold validation to mitigate overfitting. In each fold, the dataset was divided into five equal subsets: four folds were used for training and one for testing, rotating through all folds. Performance metrics were then averaged across all five folds. Evaluation metrics included the coefficient of determination (R²) to assess the proportion of variance explained by the model and shows how much of the change in HbA1c can be explained by the model, root mean squared error (RMSE) to penalize large prediction errors, and mean absolute error (MAE) to quantify the average magnitude of prediction errors. (8, 15) Clinical Interpretability Model interpretability was achieved using SHAP to identify both global feature importance and individual-level drivers.(16) Patients with predicted HbA1c levels >8% were flagged as high-risk, requiring further analysis. Results The study included 223 patients with a mean age was 57.4 ± 9.8 years, and 50.7% were females. Most participants had a history of HTN (71.3%), followed by CKD (11.7%), while smaller proportions were identified as smokers (3.1%). The mean FBG was 9.13 ± 3.41 mmol/L, while the mean HbA1c was 9.24 ± 1.64%. The mean total daily insulin dose was 66.35 ± 56.29 units/day. (Table 1) Table 2 summarizes the predictive performance of four supervised regression models used to estimate HbA1c levels. LR demonstrated performed best overall performance, achieving the highest coefficient of determination (R²=0.28) and a relatively low RMSE (1.54) and MAE (1.21). RF showed a slightly lower R² (0.26) but achieved the lowest MAE (1.18), indicating superior average prediction accuracy despite marginally higher RMSE (1.56). The SVR was able to capture nonlinear trends but underperformed in terms of both R² (0.19) and error metrics (RMSE=1.63; MAE=1.26), suggesting limited generalizability or insufficient tuning for this dataset. XGBoost although had the lowest R² (0.07) but it yielded the highest prediction error (RMSE=1.75; MAE=1.30), indicating poor model fit due potential overfitting or feature misalignment. Further, an ensemble learning using voting regressor method offered weak to moderate performance with R² of 0.165; and lower prediction error than XGBoost (RMSE = 1.749; MAE = 1.291), while MAPE was 12.6%, suggesting reasonable proportional accuracy and better generalizability. Replication using ANOVA selected top features yielded comparable results, with MAPE remaining within clinically acceptable bounds (~13%). Overall, while the LR and RF models demonstrated moderate ability to predict HbA1c levels, the RF achieved the most balanced predictive accuracy and robustness. Figure 1 illustrates the ranked feature importance scores derived from the RF model used to predict HbA1c levels. FBG and diastolic blood pressure (DBP) emerged as most influential predictors both showing the highest importance scores (>0.16), indicating their strong associations with glycemic control. Age, total daily insulin dose, duration of T2DM and BMI followed as key predictors, each contributing substantially to model performance. Systolic blood pressure (SBP), and serum magnesium markers, including; tMg and iMg were also among the most influential features, reinforcing their relevance in glycemic metabolism. Interestingly, medication adherence level showed moderate importance, suggesting that while behavior-related factors influence HbA1c, physiological and treatment-related parameters played a stronger role in prediction accuracy. Other clinical variables such sex and comorbidities showed lower, yet non-negligible contributions. Figure 2 , illustrates the direction and magnitude of each predictor’s contribution to HbA1c predictions using SHAP analysis. Each point represents an individual prediction, with colors indicating feature values (red = high, blue = low), and the x-axis reflects the SHAP value, quantifying a feature’s impact on increasing or decreasing predicted HbA1c levels. Higher DBP and longer diabetes duration were strongly associated with elevated HbA1c levels. BMI, FDG, age, and serum magnesium also showed prominent effects, where higher levels were generally predictive of poor glycemic control. Interestingly, insulin total daily dose showed a moderate positive influence, likely reflecting its use in patients with more advanced or resistant T2DM. In contrast, medication adherence exhibited a consistent but a negative SHAP value pattern, suggesting that better adherence (in red) was associated with lower HbA1c levels (i.e. glycemic control). Discussion This study evaluated the predictive performance of traditional LR compared to more advances ML models for estimating HbA1c levels in patients with uncontrolled T2DM, using a collective of clinically relevant dataset and medication adherence variables. A key strength of this study lies in its incorporation of SHAP to enhance model interpretability and identify individualized glycemic risk stratification. Among the models tested, LR demonstrated the highest explanatory predication, while RF offered the lowest average prediction error. SHAP analysis of the XGBoost model revealed that FBG, DBP, BMI, insulin dose, serum magnesium concentrations, and medication adherence levels were among the most influential predictors. Moreover, a novel finding in our analysis was the identification of DBP as a key predictor of HbA1c levels. In this study, although RF moderately predicted HbA1c levels, LR outperformed more complex ML-models, including XGBoost and SVR in terms of R² and error metrics. This finding is aligns with the landmark systematic review, which concluded that ML models do not consistently outperform LR in clinical prediction tasks. (12) Several methodological strengths in our study reinforce this outcome. First, the integration of relevant predictors including demographic, clinical, biochemical, and behavioral data provided a multidimensional database. Second, explainable ML methods such as SHAP enabled interpretation of individual-level predictors contribution. The observation that simpler models as LR outperforming theoretically more powerful ones have several plausible explanations. Our dataset is considered moderate sample size that favors more stable and interpretable models like LR which is prone to overfitting than complex models. (12) Additionally, the relationships between predictors such as FBG, BMI, DBP, insulin dose, and magnesium concentration and HbA1c levels appeared to be largely linear or additive, diminishing the advantage of ML models designed to capture y complex nonlinear interactions.(8) Lastly, although models like XGBoost captured local interpretability via SHAP, their poor performance metrics (R²=0.07) suggest overfitting or misalignment with the feature structure. Techniques such as column sampling and reducing the learning rate of new trees have been discussed in the literature as effective strategies to further limit overfitting of the XGBoost model.(17) Whereas ensemble learning using a voting regressor was explored to combine the strengths of individual models, its performance remained relatively weak, suggesting that in this moderately sized, low-dimensional dataset, integrating weak-to-moderate base learners did not substantially improve predictive accuracy or offer additive value. As previously reported, transparency and ease of deployment are crucial for model adoption in routine care. (15, 16) In the current study, while SHAP improved ML model interpretability, its practical utility was limited by the model’s suboptimal fit. Nevertheless, both LR and ML models facilitated actionable insights, confirming that FBG, insulin dose, BMI and medication adherence are strong predictors of glycemic control.(2, 5, 6, 18, 19) While previous studies have linked DBP to cardiovascular risk and DM onset, its role as a direct predictor of glycemic control has been considered limited. (20, 21) In contrast, our SHAP summary plot demonstrated a consistent and positive contribution of higher DBP values to elevated HbA1c predictions. This result suggests that DBP may capture underlying vascular or metabolic dysfunction relevant to poor glycemic outcomes, particularly in our cohort of patients with uncontrolled T2DM. These findings warrant further investigation into DBP as a potentially underrecognized indicator of glycemic burden in high-risk populations.(20) Our findings, however, do not negate the potential of ML models for clinical predications. Studies using larger, more diverse datasets with improved model tuning and cross-validation have demonstrated the superiority of ML models in specific contexts. For instance, Tao et al. (2023) reported that tree-based models achieved AUCs > 0.8 in population-level datasets. However, such performance gains are likely dependent on high-dimensional features, longitudinal inputs, and larger training sets.(2, 22) While incorporating additional predictive features or external datasets could enhance model performance and generalizability, this approach was not feasible in the current study due to the limited sample size, and doing so could increases the risk of overfitting thereby compromising predictive validity. This study is limited by its single-center, cross-sectional design, and lack of external validation. Feature engineering was restricted to a predefined set of variables, which may have limited model learning capacity of more complex models. Despite these limitations, our results reaffirm that in structured, low-dimensional datasets, LR remains a robust, interpretable, and clinically useful model. Conclusion Although the RF model demonstrated moderate predictive ability, LR outperformed the more complex ML models in this dataset. The choice between methods should consider the clinical context, and data complexity. In this study, SHAP analysis highlighted FBG, DBP, BMI, insulin dose, magnesium concentrations, and medication adherence as influential predictors, supporting the use of explainable ML for personalized glycemic risk stratification. While LR remains valuable for its simplicity, future research should validate these models using larger, multi-center datasets and external validation with more features to enhance predictive accuracy and generalizability. Abbreviations AUCs Area Under the Curves BMI Body Mass Index BP Blood Pressure CKD Chronic Kidney Disease CSIEDE 2022 International Conference on Computer Science, Information Engineering and Digital Economy 2022 DBP Diastolic Blood Pressure DLP Dyslipidemia FBG Fasting Blood Glucose HTN Hypertension LR Linear Regression MAE Mean Absolute Error MAPE Mean Absolute Percentage Error ML Machine Learning MMAS-8 Morisky Medication Adherence Scale-8 RF Random Forest RMSE Root Mean Squared Error SBP Systolic Blood Pressure SHAP SHapley Additive exPlanations SVR Support Vector Regression T2DM Type 2 Diabetes Mellitus XGBoost Extreme Gradient Boosting Declarations Ethics approval and consent to participate This study received ethical clearance from the Medical and Research Ethics Committee of the College of Medicine and Health Sciences at Sultan Qaboos University, Muscat, Oman (Reference No. MREC #2951; approval date: 22 February 2023), in accordance with the Declaration of Helsinki. Informed consent to participate was obtained from all patients prior to their involvement in the study. For participants under the age of 16, consent was obtained from their parents or legal guardians in accordance with ethical guidelines. Consent for publication This manuscript is original and has not been published, nor is it under consideration for publication elsewhere. All authors have read and approved the final manuscript and have made significant contributions to its conception and preparation. Availability of data and materials The datasets generated and analyzed during the current study are available from the corresponding author upon reasonable request. Competing Interests The authors declare no competing interests related to the content of this study. Funding This study was supported by the Ministry of Higher Education, Research and Innovation through the Block Funding Program (Grant No. RC/RG-MED/PHAR/23/01), date of approval; 1 st November 2022. Authors’ contributions Conceptualization: JM; Methodology: JM; Data curation: JM; Project administration, resources, and funding: MZ and JM; Formal analysis: JM; Validation: AA; Supervision: MZ and IZ; Drafting the manuscript: JM; Review & editing; All co-authors. Acknowledgments We extend our sincere gratitude to © 2007 Donald E. Morisky for granting permission to use the Morisky Medication Adherence Scale-8 (MMAS-8) (Certification Number: 1350). The content, name, and trademarks of the MMAS-8 are protected under U.S. copyright and trademark laws. Authorization is required for its use and coding. Licensing information is available through MMAR, LLC at www.moriskyscale.com. References Chandra G, Lavikainen P, Siirtola P, Tamminen S, Ihalapathirana A, Laatikainen T, et al. Explainable Prediction of Long-Term Glycated Hemoglobin Response Change in Finnish Patients with Type 2 Diabetes Following Drug Initiation Using Evidence-Based Machine Learning Approaches. Clin Epidemiol. 2025;17:225-40. Tao X, Jiang M, Liu Y, Hu Q, Zhu B, Hu J, et al. Predicting three-month fasting blood glucose and glycated hemoglobin changes in patients with type 2 diabetes mellitus based on multiple machine learning algorithms. Scientific Reports. 2023;13. Fu X, Wang Y, Cates R, Li N, Liu J, Ke D, et al. Implementation of five machine learning methods to predict the 52-week blood glucose level in patients with type 2 diabetes. Frontiers in Endocrinology. 2023;13. Tong Y-T, Gao G-J, Chang H, Wu X-W, Li M-T. Development and economic assessment of machine learning models to predict glycosylated hemoglobin in type 2 diabetes. Frontiers in Pharmacology. 2023;Volume 14 - 2023. Petridis P, Kristo A, Sikalidis A, Kitsas I. A Review on Trending Machine Learning Techniques for Type 2 Diabetes Mellitus Management. Informatics. 2024;11:70. Zhang L, Wang Y, Niu M, Wang C, Wang Z. Machine learning for characterizing risk of type 2 diabetes mellitus in a rural Chinese population: the Henan Rural Cohort Study. Scientific Reports. 2020;10. Cheng Y, Wu Y, Lin K-D, Lin C, Lin I. Using Machine Learning for the Risk Factors Classification of Glycemic Control in Type 2 Diabetes Mellitus. Healthcare. 2023;11. Fregoso-Aparicio L, Noguez J, Montesinos L, García-García JA. Machine learning and deep learning predictive models for type 2 diabetes: a systematic review. Diabetology & Metabolic Syndrome. 2021;13(1):148. Lee K, Kim JS, Kim Y, Goak I, Jin H, Park S, et al. A Machine Learning-Based Prediction Model for Diabetic Kidney Disease in Korean Patients with Type 2 Diabetes Mellitus. Journal of Clinical Medicine. 2025;14. Zhan W. A Comparative Study on Machine Learning Based Type 2 Diabetes Mellitus Prediction. Proceedings of the 2022 International Conference on Computer Science, Information Engineering and Digital Economy (CSIEDE 2022). 2022. Bhat S, Selvam V, Ansari G, Ansari MD. Hybrid Prediction Model for Type-2 Diabetes Mellitus using Machine Learning Approach. 2022 Seventh International Conference on Parallel, Distributed and Grid Computing (PDGC). 2022:150-5. Christodoulou E, Ma J, Collins GS, Steyerberg EW, Verbakel JY, Van Calster B. A systematic review shows no performance benefit of machine learning over logistic regression for clinical prediction models. Journal of Clinical Epidemiology. 2019;110:12-22. Bress AP, Bellows BK, King JB, Hess R, Beddhu S, Zhang Z, et al. Cost-Effectiveness of Intensive versus Standard Blood-Pressure Control. N Engl J Med. 2017;377(8):745-55. Berlowitz DR, Foy CG, Kazis LE, Bolin LP, Conroy MB, Fitzpatrick P, et al. Effect of Intensive Blood-Pressure Treatment on Patient-Reported Outcomes. N Engl J Med. 2017;377(8):733-44. Lundberg SM, Erion G, Chen H, DeGrave A, Prutkin JM, Nair B, et al. From Local Explanations to Global Understanding with Explainable AI for Trees. Nat Mach Intell. 2020;2(1):56-67. Ponce-Bobadilla AV, Schmitt V, Maier CS, Mensing S, Stodtmann S. Practical guide to SHAP analysis: Explaining supervised machine learning model predictions in drug development. Clin Transl Sci. 2024;17(11):e70056. Zou Z, Wang B, Hu X, Deng Y, Wan H, Jin H. Enhancing requirements-to-code traceability with GA-XWCoDe: Integrating XGBoost, Node2Vec, and genetic algorithms for improving model performance and stability. J King Saud Univ Comput Inf Sci. 2024;36:102197. Al-Maqbali JS, Al Harasi S, Al Mamary Q, Falhammar H, Al-Zakwani I, Al Za'abi M, et al. Ionized and total magnesium levels and health outcomes in patients with type 2 diabetes mellitus. Sci Rep. 2025;15(1):4329. Maqrashi NAB, Salim Al; Al-Rasbi, Sara; Alawi, Abdullah M. Al; and Al-Maqbali, Juhaina S. Effect of Magnesium Supplements on Improving Glucose Control, Blood Pressure and Lipid Profile in Patients With Type 2 Diabetes Mellitus: A systematic review and meta-analysis. Sultan Qaboos University Medical Journal.25(1):382-94 Wan E, Fong D, Fung C, Lam C. Incidence and predictors for cardiovascular disease in Chinese patients with type 2 diabetes mellitus - a population-based retrospective cohort study. Journal of diabetes and its complications. 2016;30 3:444-50. Awad N, Saade R, Bassil M, Sukkarieh-Haraty O, Egede L. Relationship between social determinants of health and clinical outcomes in adults with type 2 diabetes in Lebanon. Journal of the National Medical Association. 2022. Edelsbrunner P, Simonsmeier B, Schneider M. The Cronbach’s Alpha of Domain-Specific Knowledge Tests Before and After Learning: A Meta-Analysis of Published Studies. Educational Psychology Review. 2025. Tables Table 1. Summary of categorical and continuous predictors demographic, clinical, and biochemical characteristics of the study population (n=223). Variable n (%), unless otherwise specified Total 223 (100%) Categorical predictors Female 113 (50.7%) Smoking 7 (3.1%) Alcohol use 1 (0.4%) Hypertension 159 (71.3%) Chronic kidney disease 26 (11.7%) Continuous predictors Age, mean ± S D, years 57.37 ± 9.80 Body mass index, mean ± SD, kg/m² 30.27 ± 5.93 Systolic blood pressure, mean ± SD, mmHg 135.52 ± 19.31 Diastolic blood pressure, mean ± SD, mmHg 73.64 ± 12.21 Fasting blood glucose, mean ± SD, mmol/L 9.13 ± 3.41 Glycated hemoglobin, mean ± SD, % 9.24 ± 1.64 Total serum magnesium, mean ± SD, mmol/L 0.82 ± 0.08 Ionized serum magnesium, mean ± SD, mmol/L 0.61 ± 0.09 Total daily insulin dose, mean ± SD, units/day 66.35 ± 56.29 SD, standard deviation; kg, kilogram. Table 2. Model performance comparison. Model R² RMSE MAE Explanation Linear regression 0.28 1.54 1.21 Predicted HbA1c levels fairly well overall and had small average errors. Random forest 0.26 1.56 1.18 Almost as good as LR but made the smallest average errors. Support vector regression 0.19 1.63 1.26 Didn’t predict well and made more errors than the first two models. Eextreme gradient boosting 0.07 1.75 1.30 Performed poorly and made the biggest errors—likely not a good model for this data. Voting regressor 0.17 1.75 1.29 Ensemble model combining others; weak-moderate performance. R 2 ; Coefficient of determination, RMSE; root mean squared error, MAE; mean absolute error Additional Declarations No competing interests reported. Supplementary Files MMAS8licenseforuse.pdf MMAS8waveforsubsetmanuscript.pdf Cite Share Download PDF Status: Posted Version 1 posted You are reading this latest preprint version Research Square lets you share your work early, gain feedback from the community, and start making changes to your manuscript prior to peer review in a journal. As a division of Research Square Company, we’re committed to making research communication faster, fairer, and more useful. We do this by developing innovative software and high quality services for the global research community. Our growing team is made up of researchers and industry professionals working together to solve the most critical problems facing scientific publishing. Also discoverable on Platform About Our Team In Review Editorial Policies Advisory Board Help Center Resources Author Services Accessibility API Access RSS feed Manage Cookie Preferences © Research Square 2026 | ISSN 2693-5015 (online) Privacy Policy Terms of Service Do Not Sell My Personal Information {"props":{"pageProps":{"initialData":{"identity":"rs-7292468","acceptedTermsAndConditions":true,"allowDirectSubmit":true,"archivedVersions":[],"articleType":"Research Article","associatedPublications":[],"authors":[{"id":512756128,"identity":"10bd1f7f-24bf-4bc7-9413-8d0567ea52b3","order_by":0,"name":"Juhaina Salim Al-Maqbali","email":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAAAyAQMAAABI0h/eAAAABlBMVEX///8AAABVwtN+AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAzUlEQVRIiWNgGAWjYBACxgYeBoYEBgY5CJeNBC3GxGthYOABk4kNRGthnpF78MPDHXbp89tzDBg+lB1m4Bc7QMBhM/KSJRLPJOduOPPGgHHGucMMkrMTCGnJMZBIbGPO3SCRY8DM23aYweA2YS3GPxLb6tPlgXqZ/xKpxQxoy+EEhhtALYxEael5Y2aR2HbccMOZZwUHe86l8xD0i2F7jvHNn23V8vLtyRsf/CizluOXJqSlAc5MYDjAAIsmfEAewSRg+CgYBaNgFIxcAABoh0NqUc+e8gAAAABJRU5ErkJggg==","orcid":"","institution":"Sultan Qaboos University","correspondingAuthor":true,"prefix":"","firstName":"Juhaina","middleName":"Salim","lastName":"Al-Maqbali","suffix":""},{"id":512756129,"identity":"d734394b-632a-4fb7-bce3-aee340dc9026","order_by":1,"name":"Ibrahim Al-Zakwani","email":"","orcid":"","institution":"Sultan Qaboos University","correspondingAuthor":false,"prefix":"","firstName":"Ibrahim","middleName":"","lastName":"Al-Zakwani","suffix":""},{"id":512756134,"identity":"086669a6-8584-49ba-83ab-4c614f65759d","order_by":2,"name":"Abdullah M. Al Alawi","email":"","orcid":"","institution":"University Medical City","correspondingAuthor":false,"prefix":"","firstName":"Abdullah","middleName":"M. Al","lastName":"Alawi","suffix":""},{"id":512756135,"identity":"aa8f8270-6ba1-4d43-9d5a-955aef73778b","order_by":3,"name":"Mohammed Al Za’abi","email":"","orcid":"","institution":"Sultan Qaboos University","correspondingAuthor":false,"prefix":"","firstName":"Mohammed","middleName":"Al","lastName":"Za’abi","suffix":""}],"badges":[],"createdAt":"2025-08-04 14:53:38","currentVersionCode":1,"declarations":"","doi":"10.21203/rs.3.rs-7292468/v1","doiUrl":"https://doi.org/10.21203/rs.3.rs-7292468/v1","draftVersion":[],"editorialEvents":[],"editorialNote":"","failedWorkflow":false,"files":[{"id":91086443,"identity":"bcb2c65d-6d1e-4e02-8524-2926cade62ea","added_by":"auto","created_at":"2025-09-11 12:25:40","extension":"png","order_by":1,"title":"Figure 1","display":"","copyAsset":false,"role":"figure","size":33989,"visible":true,"origin":"","legend":"\u003cp\u003eTop feature importance in predicting HbA1c levels using RF model.\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e(HbA1c; glycated hemoglobin, RF; random frost, FBG; fasting blood glucose, DBP; diastolic blood pressure, BMI; body mass index, tMg: total serum magnesium, SBP; systolic blood pressure, iMg; ionized serum magnesium, HTN: hypertension, DLP; Dyslipidemia, CKD; chronic kidney disease)\u003c/em\u003e\u003c/p\u003e","description":"","filename":"1.png","url":"https://assets-eu.researchsquare.com/files/rs-7292468/v1/a7c5f8b60db7b3fb990c28b9.png"},{"id":91086407,"identity":"95c0ce2c-cb92-452e-bbb9-0e33b7e3ca8e","added_by":"auto","created_at":"2025-09-11 12:25:33","extension":"png","order_by":2,"title":"Figure 2","display":"","copyAsset":false,"role":"figure","size":57209,"visible":true,"origin":"","legend":"\u003cp\u003eSHAP summary plot for XGBoost model.\u003c/p\u003e\n\u003cp\u003e\u003cem\u003e(DBP; diastolic blood pressure, BMI; body mass index, FBG; fasting blood glucose, iMg; ionized serum magnesium, tMg: total serum magnesium, SBP; systolic blood pressure, DLP; Dyslipidemia, HTN; Hypertensin.)\u003c/em\u003e\u003c/p\u003e","description":"","filename":"2.png","url":"https://assets-eu.researchsquare.com/files/rs-7292468/v1/26e23e07dac3be14bf8a9ebc.png"},{"id":106412910,"identity":"9bacfd77-7d00-4905-9c2c-f18df5c829a1","added_by":"auto","created_at":"2026-04-08 10:02:18","extension":"pdf","order_by":0,"title":"","display":"","copyAsset":false,"role":"manuscript-pdf","size":744783,"visible":true,"origin":"","legend":"","description":"","filename":"manuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7292468/v1/b46682d7-ec1d-4c2c-a6d5-255c75196dc8.pdf"},{"id":91086445,"identity":"383414d1-3575-43d7-8591-20516951f628","added_by":"auto","created_at":"2025-09-11 12:25:40","extension":"pdf","order_by":1,"title":"","display":"","copyAsset":false,"role":"supplement","size":212825,"visible":true,"origin":"","legend":"","description":"","filename":"MMAS8licenseforuse.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7292468/v1/51f58c22076840a7d135f056.pdf"},{"id":91086412,"identity":"a8a00e49-8dbc-4672-af2b-9d14a739d5f3","added_by":"auto","created_at":"2025-09-11 12:25:34","extension":"pdf","order_by":2,"title":"","display":"","copyAsset":false,"role":"supplement","size":2407633,"visible":true,"origin":"","legend":"","description":"","filename":"MMAS8waveforsubsetmanuscript.pdf","url":"https://assets-eu.researchsquare.com/files/rs-7292468/v1/eb57b21130e77ec759c33c3c.pdf"}],"financialInterests":"No competing interests reported.","formattedTitle":"Comparative Performance of Linear Regression and Machine Learning Models for Predicting Glycemic Status in Uncontrolled Type 2 Diabetes: SHAP-Based Analysis","fulltext":[{"header":"Introduction","content":"\u003cp\u003eThe integration of machine learning (ML) in clinical prediction modeling has attracted considerable interest, particularly in the management of chronic conditions like type 2 diabetes mellitus (T2DM). The individualized risk prediction of T2DM patient could enhance outcomes and guide treatment decisions.(1) Among the most consistently identified predictors by ML models are baseline glycated hemoglobin (HbA1c) and fasting blood glucose (FBG) levels .(2, 3, 4) Other predictors include medication adherence, dietary habits, depression, body mass index (BMI), waist circumference, and disease duration.(2, 5, 6) Additionally, ML has also revealed emerging predictors such as negative emotions, urinary biomarkers, heart rate variability, and insulin resistance that may be especially relevant in certain patient subgroups.(5, 6, 7)\u003c/p\u003e\u003cp\u003eTree-based models such as random frost (RF) and gradient boosting machine such XGBoost, often outperform other algorithms in predictive accuracy, often achieving area under the curves (AUCs) above 0.80, indicating strong predictive performance.(2, 5, 7, 8) These models support early identification of high-risk patients and help guide individualized treatment, especially when handling non-linear relationships and/or high-dimensional data.(3, 7, 9, 10).\u003c/p\u003e\u003cp\u003eDespite the increasing use of ML, logistic regression (LR) remains a widely used method, particularly for smaller datasets with linear associations and fewer feature sets (9, 11), consistently identifying key predictors such as FBG, HbA1c, BMI, age, lipid profiles, and diabetes duration.(3, 7, 9). It is characterized by ease of implementation and interpretability. (11). In contrast, ML models offer greater flexibility and accuracy in complex datasets and large-scale clinical applications.(3, 7, 9, 10)\u003c/p\u003e\u003cp\u003eA landmark systematic review by Christodoulou et al. (2019) challenged the perceived superiority of ML models, reporting no consistent performance benefits of ML models over LR in clinical prediction tasks.(12) Although ML algorithms are capable of modelling complex nonlinear interactions across diverse data domains, their generalizability and reliability in outperforming traditional LR methods remains to be explored.\u003c/p\u003e\u003cp\u003eThis study aims to evaluate and compare the predictive performance of LR and ML models in estimating HbA1c levels among patients with uncontrolled T2DM using integrated clinical, biochemical, and medication adherence data. Moreover, the study employed Shapley Additive exPlanations (SHAP) to improve model interpretability, facilitate individualized risk stratification, and support data-driven clinical decision-making.\u003c/p\u003e"},{"header":"Methods","content":"\u003cp\u003e\u003cstrong\u003eStudy Design\u003c/strong\u003e\u003cstrong\u003e, Population and Setting \u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis is a cross-sectional observational study included adult patients (≥18 years old) diagnosed with T2DM and having uncontrolled glycemic status, defined as HbA1c ≥7% based on the most recent reading in the last 6 months. The study was conducted at a tertiary care teaching hospital with referral services that provide specialized medical facilities like endocrinology. Informed consent to participate was obtained from all patients prior to their involvement in the study. For participants under the age of 16, consent was obtained from their parents or legal guardians in accordance with ethical guidelines.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eOutcome and Predictors\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe primary outcome was HbA1c level. Predictor variables included demographic characteristics: age, sex; clinical parameters: duration of diabetes mellitus, comorbidities (such as hypertension (HTN), dyslipidemia (DLP), and chronic kidney disease (CKD)); laboratory parameters (blood pressure (BP), fasting blood glucose (FBG), serum total magnesium (tMg) and serum ionized magnesium (iMg) concentrations; body mass index (BMI); medication data (metformin, sulfonylureas, DPP-4 inhibitors, SGLT2 inhibitors, and insulin doses); and adherence assessment which was stratified into high, medium, and low levels based on Morisky Medication Adherence Scale-8 (MMAS-8).(13, 14) The required permission for use of the scale and its coding was obtained through the licensed agreement with certification number 1350 (available from MMAR, LLC.,www.moriskyscale.com.\u003cstrong\u003e\u003cem\u003e,\u003c/em\u003e\u003c/strong\u003e© 2007 Donald E. Morisky).\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eData Preprocessing and Modeling\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eRecords with any missing predictor values were excluded from the analysis. Continuous variables were standardized by z-scores; categorical variables were label-encoded. Feature selection was performed using the ANOVA F-test through the SelectKBest to identify the top predictive continuous variables. In addition, permutation importance was applied to the trained RF model to assess the relative importance of different features. Four supervised regression models were developed: LR to serve as a baseline comparator, RF to model nonlinear relationships and interactions, XGBoost for advanced tree-based boosting, and support vector regression (SVR) for handling high-dimensional and non-linear data with kernel functions.(8, 15) An 80/20 train-test split was used for initial model development.\u003c/p\u003e\n\u003cp\u003eThe ensemble method “voting regressor” was performed to reduce variance and bias by combining the strengths of multiple models (LR, RF, and XGBoost). Replication was performed independently and performance was evaluated using mean absolute percentage error (MAPE). \u003c/p\u003e\n\u003cp\u003eThe data analysis was conducted using Python version 3.12.7, provided by Anaconda, Inc., within a Jupyter Notebook environment. \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eModel Evaluation\u003c/strong\u003e\u003cstrong\u003e and validation\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eModel performance was assessed using 5-fold validation to mitigate overfitting. In each fold, the dataset was divided into five equal subsets: four folds were used for training and one for testing, rotating through all folds. Performance metrics were then averaged across all five folds. Evaluation metrics included the coefficient of determination (R²) to assess the proportion of variance explained by the model and shows how much of the change in HbA1c can be explained by the model, root mean squared error (RMSE) to penalize large prediction errors, and mean absolute error (MAE) to quantify the average magnitude of prediction errors. (8, 15) \u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eClinical Interpretability\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eModel interpretability was achieved using SHAP to identify both global feature importance and individual-level drivers.(16) Patients with predicted HbA1c levels \u0026gt;8% were flagged as high-risk, requiring further analysis. \u003c/p\u003e"},{"header":"Results","content":"\u003cp\u003eThe study included 223 patients with a mean age was 57.4 \u0026plusmn; 9.8 years, and 50.7% were females. Most participants had a history of HTN (71.3%), followed by CKD (11.7%), while smaller proportions were identified as smokers (3.1%). The mean FBG was 9.13 \u0026plusmn; 3.41 mmol/L, while the mean HbA1c was 9.24 \u0026plusmn; 1.64%. The mean total daily insulin dose was 66.35 \u0026plusmn; 56.29 units/day. \u003cstrong\u003e(Table 1)\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eTable 2\u003c/strong\u003e summarizes the predictive performance of four supervised regression models used to estimate HbA1c levels. LR demonstrated performed best overall performance, achieving the highest coefficient of determination (R\u0026sup2;=0.28) and a relatively low RMSE (1.54) and MAE (1.21). RF showed a slightly lower R\u0026sup2; (0.26) but achieved the lowest MAE (1.18), indicating superior average prediction accuracy despite marginally higher RMSE (1.56). The SVR was able to capture nonlinear trends but underperformed in terms of both R\u0026sup2; (0.19) and error metrics (RMSE=1.63; MAE=1.26), suggesting limited generalizability or insufficient tuning for this dataset. XGBoost although had the lowest R\u0026sup2; (0.07) but it yielded the highest prediction error (RMSE=1.75; MAE=1.30), indicating poor model fit due potential overfitting or feature misalignment.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eFurther, an ensemble learning using voting regressor method offered weak to moderate performance with R\u0026sup2; of 0.165; and lower prediction error than XGBoost (RMSE = 1.749; MAE = 1.291), while MAPE was 12.6%, suggesting reasonable proportional accuracy and better generalizability.\u003c/p\u003e\n\u003cp\u003eReplication using ANOVA selected top features yielded comparable results, with MAPE remaining within clinically acceptable bounds (~13%).\u0026nbsp;\u003c/p\u003e\n\u003cp\u003eOverall, while the LR and RF models demonstrated moderate ability to predict HbA1c levels, the RF achieved the most balanced predictive accuracy and robustness.\u0026nbsp;\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFigure 1\u003c/strong\u003e illustrates the ranked feature importance scores derived from the RF model used to predict HbA1c levels. FBG and diastolic blood pressure (DBP) emerged as most influential predictors both showing the highest importance scores (\u0026gt;0.16), indicating their strong associations with glycemic control. Age, total daily insulin dose, duration of T2DM and BMI followed as key predictors, each contributing substantially to model performance. Systolic blood pressure (SBP), and serum magnesium markers, including; tMg and iMg were also among the most influential features, reinforcing their relevance in glycemic metabolism. Interestingly, medication adherence level showed moderate importance, suggesting that while behavior-related factors influence HbA1c, physiological and treatment-related parameters played a stronger role in prediction accuracy. Other clinical variables such sex and comorbidities showed lower, yet non-negligible contributions.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFigure 2\u003c/strong\u003e, illustrates the direction and magnitude of each predictor\u0026rsquo;s contribution to HbA1c predictions using SHAP analysis. Each point represents an individual prediction, with colors indicating feature values (red = high, blue = low), and the x-axis reflects the SHAP value, quantifying a feature\u0026rsquo;s impact on increasing or decreasing predicted HbA1c levels. Higher DBP and longer diabetes duration were strongly associated with elevated HbA1c levels. BMI, FDG, age, and serum magnesium also showed prominent effects, where higher levels were generally predictive of poor glycemic control. Interestingly, insulin total daily dose showed a moderate positive influence, likely reflecting its use in patients with more advanced or resistant T2DM. In contrast, medication adherence exhibited a consistent but a negative SHAP value pattern, suggesting that better adherence (in red) was associated with lower HbA1c levels (i.e. glycemic control).\u0026nbsp;\u003c/p\u003e"},{"header":"Discussion","content":"\u003cp\u003eThis study evaluated the predictive performance of traditional LR compared to more advances ML models for estimating HbA1c levels in patients with uncontrolled T2DM, using a collective of clinically relevant dataset and medication adherence variables. A key strength of this study lies in its incorporation of SHAP to enhance model interpretability and identify individualized glycemic risk stratification.\u003c/p\u003e\u003cp\u003eAmong the models tested, LR demonstrated the highest explanatory predication, while RF offered the lowest average prediction error. SHAP analysis of the XGBoost model revealed that FBG, DBP, BMI, insulin dose, serum magnesium concentrations, and medication adherence levels were among the most influential predictors. Moreover, a novel finding in our analysis was the identification of DBP as a key predictor of HbA1c levels.\u003c/p\u003e\u003cp\u003eIn this study, although RF moderately predicted HbA1c levels, LR outperformed more complex ML-models, including XGBoost and SVR in terms of R\u0026sup2; and error metrics. This finding is aligns with the landmark systematic review, which concluded that ML models do not consistently outperform LR in clinical prediction tasks. (12) Several methodological strengths in our study reinforce this outcome. First, the integration of relevant predictors including demographic, clinical, biochemical, and behavioral data provided a multidimensional database. Second, explainable ML methods such as SHAP enabled interpretation of individual-level predictors contribution.\u003c/p\u003e\u003cp\u003eThe observation that simpler models as LR outperforming theoretically more powerful ones have several plausible explanations. Our dataset is considered moderate sample size that favors more stable and interpretable models like LR which is prone to overfitting than complex models. (12) Additionally, the relationships between predictors such as FBG, BMI, DBP, insulin dose, and magnesium concentration and HbA1c levels appeared to be largely linear or additive, diminishing the advantage of ML models designed to capture y complex nonlinear interactions.(8) Lastly, although models like XGBoost captured local interpretability via SHAP, their poor performance metrics (R\u0026sup2;=0.07) suggest overfitting or misalignment with the feature structure. Techniques such as column sampling and reducing the learning rate of new trees have been discussed in the literature as effective strategies to further limit overfitting of the XGBoost model.(17) Whereas ensemble learning using a voting regressor was explored to combine the strengths of individual models, its performance remained relatively weak, suggesting that in this moderately sized, low-dimensional dataset, integrating weak-to-moderate base learners did not substantially improve predictive accuracy or offer additive value.\u003c/p\u003e\u003cp\u003eAs previously reported, transparency and ease of deployment are crucial for model adoption in routine care. (15, 16) In the current study, while SHAP improved ML model interpretability, its practical utility was limited by the model\u0026rsquo;s suboptimal fit. Nevertheless, both LR and ML models facilitated actionable insights, confirming that FBG, insulin dose, BMI and medication adherence are strong predictors of glycemic control.(2, 5, 6, 18, 19) While previous studies have linked DBP to cardiovascular risk and DM onset, its role as a direct predictor of glycemic control has been considered limited. (20, 21) In contrast, our SHAP summary plot demonstrated a consistent and positive contribution of higher DBP values to elevated HbA1c predictions. This result suggests that DBP may capture underlying vascular or metabolic dysfunction relevant to poor glycemic outcomes, particularly in our cohort of patients with uncontrolled T2DM. These findings warrant further investigation into DBP as a potentially underrecognized indicator of glycemic burden in high-risk populations.(20)\u003c/p\u003e\u003cp\u003eOur findings, however, do not negate the potential of ML models for clinical predications. Studies using larger, more diverse datasets with improved model tuning and cross-validation have demonstrated the superiority of ML models in specific contexts. For instance, Tao et al. (2023) reported that tree-based models achieved AUCs\u0026thinsp;\u0026gt;\u0026thinsp;0.8 in population-level datasets. However, such performance gains are likely dependent on high-dimensional features, longitudinal inputs, and larger training sets.(2, 22) While incorporating additional predictive features or external datasets could enhance model performance and generalizability, this approach was not feasible in the current study due to the limited sample size, and doing so could increases the risk of overfitting thereby compromising predictive validity.\u003c/p\u003e\u003cp\u003eThis study is limited by its single-center, cross-sectional design, and lack of external validation. Feature engineering was restricted to a predefined set of variables, which may have limited model learning capacity of more complex models. Despite these limitations, our results reaffirm that in structured, low-dimensional datasets, LR remains a robust, interpretable, and clinically useful model.\u003c/p\u003e"},{"header":"Conclusion","content":"\u003cp\u003eAlthough the RF model demonstrated moderate predictive ability, LR outperformed the more complex ML models in this dataset. The choice between methods should consider the clinical context, and data complexity. In this study, SHAP analysis highlighted FBG, DBP, BMI, insulin dose, magnesium concentrations, and medication adherence as influential predictors, supporting the use of explainable ML for personalized glycemic risk stratification. While LR remains valuable for its simplicity, future research should validate these models using larger, multi-center datasets and external validation with more features to enhance predictive accuracy and generalizability.\u003c/p\u003e"},{"header":"Abbreviations","content":"\u003ctable border=\"0\" cellspacing=\"0\" cellpadding=\"0\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eAUCs\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eArea Under the Curves\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBMI\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBody Mass Index\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBP\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eBlood Pressure\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCKD\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eChronic Kidney Disease\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eCSIEDE 2022\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eInternational Conference on Computer Science, Information Engineering and Digital Economy 2022\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDBP\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDiastolic Blood Pressure\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDLP\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eDyslipidemia\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eFBG\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eFasting Blood Glucose\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHTN\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eHypertension\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eLR\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eLinear Regression\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMAE\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMean Absolute Error\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMAPE\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMean Absolute Percentage Error\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eML\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMachine Learning\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMMAS-8\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eMorisky Medication Adherence Scale-8\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eRF\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eRandom Forest\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eRMSE\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eRoot Mean Squared Error\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSBP\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSystolic Blood Pressure\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSHAP\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSHapley Additive exPlanations\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSVR\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eSupport Vector Regression\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eT2DM\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eType 2 Diabetes Mellitus\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eXGBoost\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\"\u003e\n \u003cp\u003eExtreme Gradient Boosting\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n\u003c/table\u003e"},{"header":"Declarations","content":"\u003cp\u003e\u003cstrong\u003eEthics approval and consent to participate\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis study received ethical clearance from the Medical and Research Ethics Committee of the College of Medicine and Health Sciences at Sultan Qaboos University, Muscat, Oman (Reference No. MREC #2951; approval date: 22 February 2023), in accordance with the Declaration of Helsinki.\u003c/p\u003e\n\u003cp\u003eInformed consent to participate was obtained from all patients prior to their involvement in the study. For participants under the age of 16, consent was obtained from their parents or legal guardians in accordance with ethical guidelines.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eConsent for publication\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis manuscript is original and has not been published, nor is it under consideration for publication elsewhere. All authors have read and approved the final manuscript and have made significant contributions to its conception and preparation.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAvailability of data and materials\u003c/strong\u003e\u003cstrong\u003e\u003cbr\u003e\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe datasets generated and analyzed during the current study are available from the corresponding author upon reasonable request.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eCompeting Interests\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThe authors declare no competing interests related to the content of this study.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eFunding\u0026nbsp;\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eThis study was supported by the Ministry of Higher Education, Research and Innovation through the Block Funding Program (Grant No. RC/RG-MED/PHAR/23/01), date of approval; 1\u003csup\u003est\u003c/sup\u003e November 2022.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAuthors\u0026rsquo; contributions\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eConceptualization: JM; Methodology: JM; Data curation: JM; Project administration, resources, and funding: MZ and JM; Formal analysis: JM; Validation: AA; Supervision: MZ and IZ; Drafting the manuscript: JM; Review \u0026amp; editing; All co-authors.\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eAcknowledgments\u003c/strong\u003e\u003c/p\u003e\n\u003cp\u003eWe extend our sincere gratitude to \u0026copy; 2007 Donald E. Morisky for granting permission to use the Morisky Medication Adherence Scale-8 (MMAS-8) (Certification Number: 1350). The content, name, and trademarks of the MMAS-8 are protected under U.S. copyright and trademark laws. Authorization is required for its use and coding. Licensing information is available through MMAR, LLC at www.moriskyscale.com.\u003c/p\u003e"},{"header":"References","content":"\u003col\u003e\n \u003cli\u003eChandra G, Lavikainen P, Siirtola P, Tamminen S, Ihalapathirana A, Laatikainen T, et al. Explainable Prediction of Long-Term Glycated Hemoglobin Response Change in Finnish Patients with Type 2 Diabetes Following Drug Initiation Using Evidence-Based Machine Learning Approaches. Clin Epidemiol. 2025;17:225-40.\u003c/li\u003e\n \u003cli\u003eTao X, Jiang M, Liu Y, Hu Q, Zhu B, Hu J, et al. Predicting three-month fasting blood glucose and glycated hemoglobin changes in patients with type 2 diabetes mellitus based on multiple machine learning algorithms. Scientific Reports. 2023;13.\u003c/li\u003e\n \u003cli\u003eFu X, Wang Y, Cates R, Li N, Liu J, Ke D, et al. Implementation of five machine learning methods to predict the 52-week blood glucose level in patients with type 2 diabetes. Frontiers in Endocrinology. 2023;13.\u003c/li\u003e\n \u003cli\u003eTong Y-T, Gao G-J, Chang H, Wu X-W, Li M-T. Development and economic assessment of machine learning models to predict glycosylated hemoglobin in type 2 diabetes. Frontiers in Pharmacology. 2023;Volume 14 - 2023.\u003c/li\u003e\n \u003cli\u003ePetridis P, Kristo A, Sikalidis A, Kitsas I. A Review on Trending Machine Learning Techniques for Type 2 Diabetes Mellitus Management. Informatics. 2024;11:70.\u003c/li\u003e\n \u003cli\u003eZhang L, Wang Y, Niu M, Wang C, Wang Z. Machine learning for characterizing risk of type 2 diabetes mellitus in a rural Chinese population: the Henan Rural Cohort Study. Scientific Reports. 2020;10.\u003c/li\u003e\n \u003cli\u003eCheng Y, Wu Y, Lin K-D, Lin C, Lin I. Using Machine Learning for the Risk Factors Classification of Glycemic Control in Type 2 Diabetes Mellitus. Healthcare. 2023;11.\u003c/li\u003e\n \u003cli\u003eFregoso-Aparicio L, Noguez J, Montesinos L, Garc\u0026iacute;a-Garc\u0026iacute;a JA. Machine learning and deep learning predictive models for type 2 diabetes: a systematic review. Diabetology \u0026amp; Metabolic Syndrome. 2021;13(1):148.\u003c/li\u003e\n \u003cli\u003eLee K, Kim JS, Kim Y, Goak I, Jin H, Park S, et al. A Machine Learning-Based Prediction Model for Diabetic Kidney Disease in Korean Patients with Type 2 Diabetes Mellitus. Journal of Clinical Medicine. 2025;14.\u003c/li\u003e\n \u003cli\u003eZhan W. A Comparative Study on Machine Learning Based Type 2 Diabetes Mellitus Prediction. Proceedings of the 2022 International Conference on Computer Science, Information Engineering and Digital Economy (CSIEDE 2022). 2022.\u003c/li\u003e\n \u003cli\u003eBhat S, Selvam V, Ansari G, Ansari MD. Hybrid Prediction Model for Type-2 Diabetes Mellitus using Machine Learning Approach. 2022 Seventh International Conference on Parallel, Distributed and Grid Computing (PDGC). 2022:150-5.\u003c/li\u003e\n \u003cli\u003eChristodoulou E, Ma J, Collins GS, Steyerberg EW, Verbakel JY, Van Calster B. A systematic review shows no performance benefit of machine learning over logistic regression for clinical prediction models. Journal of Clinical Epidemiology. 2019;110:12-22.\u003c/li\u003e\n \u003cli\u003eBress AP, Bellows BK, King JB, Hess R, Beddhu S, Zhang Z, et al. Cost-Effectiveness of Intensive versus Standard Blood-Pressure Control. N Engl J Med. 2017;377(8):745-55.\u003c/li\u003e\n \u003cli\u003eBerlowitz DR, Foy CG, Kazis LE, Bolin LP, Conroy MB, Fitzpatrick P, et al. Effect of Intensive Blood-Pressure Treatment on Patient-Reported Outcomes. N Engl J Med. 2017;377(8):733-44.\u003c/li\u003e\n \u003cli\u003eLundberg SM, Erion G, Chen H, DeGrave A, Prutkin JM, Nair B, et al. From Local Explanations to Global Understanding with Explainable AI for Trees. Nat Mach Intell. 2020;2(1):56-67.\u003c/li\u003e\n \u003cli\u003ePonce-Bobadilla AV, Schmitt V, Maier CS, Mensing S, Stodtmann S. Practical guide to SHAP analysis: Explaining supervised machine learning model predictions in drug development. Clin Transl Sci. 2024;17(11):e70056.\u003c/li\u003e\n \u003cli\u003eZou Z, Wang B, Hu X, Deng Y, Wan H, Jin H. Enhancing requirements-to-code traceability with GA-XWCoDe: Integrating XGBoost, Node2Vec, and genetic algorithms for improving model performance and stability. J King Saud Univ Comput Inf Sci. 2024;36:102197.\u003c/li\u003e\n \u003cli\u003eAl-Maqbali JS, Al Harasi S, Al Mamary Q, Falhammar H, Al-Zakwani I, Al Za\u0026apos;abi M, et al. Ionized and total magnesium levels and health outcomes in patients with type 2 diabetes mellitus. Sci Rep. 2025;15(1):4329.\u003c/li\u003e\n \u003cli\u003eMaqrashi NAB, Salim Al; Al-Rasbi, Sara; Alawi, Abdullah M. Al; and Al-Maqbali, Juhaina S. Effect of Magnesium Supplements on Improving Glucose Control, Blood Pressure and Lipid Profile in Patients With Type 2 Diabetes Mellitus: A systematic review and meta-analysis. Sultan Qaboos University Medical Journal.25(1):382-94\u003c/li\u003e\n \u003cli\u003eWan E, Fong D, Fung C, Lam C. Incidence and predictors for cardiovascular disease in Chinese patients with type 2 diabetes mellitus - a population-based retrospective cohort study. Journal of diabetes and its complications. 2016;30 3:444-50.\u003c/li\u003e\n \u003cli\u003eAwad N, Saade R, Bassil M, Sukkarieh-Haraty O, Egede L. Relationship between social determinants of health and clinical outcomes in adults with type 2 diabetes in Lebanon. Journal of the National Medical Association. 2022.\u003c/li\u003e\n \u003cli\u003eEdelsbrunner P, Simonsmeier B, Schneider M. The Cronbach\u0026rsquo;s Alpha of Domain-Specific Knowledge Tests Before and After Learning: A Meta-Analysis of Published Studies. Educational Psychology Review. 2025.\u003c/li\u003e\n\u003c/ol\u003e"},{"header":"Tables","content":"\u003cp\u003e\u003cstrong\u003eTable 1.\u0026nbsp;\u003c/strong\u003eSummary of categorical and continuous predictors demographic, clinical, and biochemical characteristics of the study population (n=223).\u003c/p\u003e\n\u003cdiv align=\"Left\"\u003e\n \u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"624\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eVariable\u003c/strong\u003e\u003c/p\u003e\n \u003cp\u003e\u003cem\u003en (%), unless otherwise specified\u0026nbsp;\u003c/em\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eTotal\u003c/strong\u003e\u003c/p\u003e\n \u003cp\u003e223 (100%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd colspan=\"2\" valign=\"top\" style=\"width: 624px;\"\u003e\n \u003cp\u003e\u003cstrong\u003e\u003cem\u003eCategorical predictors\u0026nbsp;\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Female\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e113 (50.7%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Smoking\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e7 (3.1%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Alcohol use\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e1 (0.4%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Hypertension\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e159 (71.3%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Chronic kidney disease\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e26 (11.7%)\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd colspan=\"2\" valign=\"top\" style=\"width: 624px;\"\u003e\n \u003cp\u003e\u003cstrong\u003e\u003cem\u003eContinuous predictors\u003c/em\u003e\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Age, mean \u0026plusmn; S D, years\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e57.37 \u0026plusmn; 9.80\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Body mass index, mean \u0026plusmn; SD, kg/m\u0026sup2;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e30.27 \u0026plusmn; 5.93\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Systolic blood pressure, mean \u0026plusmn; SD, mmHg\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e135.52 \u0026plusmn; 19.31\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Diastolic blood pressure, mean \u0026plusmn; SD, mmHg\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e73.64 \u0026plusmn; 12.21\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Fasting blood glucose, mean \u0026plusmn; SD, mmol/L\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e9.13 \u0026plusmn; 3.41\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Glycated hemoglobin, mean \u0026plusmn; SD, %\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e9.24 \u0026plusmn; 1.64\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Total serum magnesium, mean \u0026plusmn; SD, mmol/L\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e0.82 \u0026plusmn; 0.08\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Ionized serum magnesium, mean \u0026plusmn; SD, mmol/L\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e0.61 \u0026plusmn; 0.09\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 456px;\"\u003e\n \u003cp\u003e\u0026nbsp; \u0026nbsp; Total daily insulin dose, mean \u0026plusmn; SD, units/day\u0026nbsp;\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd style=\"width: 168px;\"\u003e\n \u003cp\u003e66.35 \u0026plusmn; 56.29\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd colspan=\"2\" valign=\"top\" style=\"width: 624px;\"\u003e\n \u003cp\u003e\u003cem\u003eSD, standard deviation; kg, kilogram.\u003c/em\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n\u003c/div\u003e\n\u003cp\u003e\u003cstrong\u003eTable 2.\u0026nbsp;\u003c/strong\u003eModel performance comparison.\u003c/p\u003e\n\u003cdiv align=\"Left\"\u003e\n \u003ctable border=\"1\" cellspacing=\"0\" cellpadding=\"0\" width=\"623\"\u003e\n \u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 174px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eModel\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 56px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eR\u0026sup2;\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 58px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eRMSE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 54px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eMAE\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 282px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eExplanation\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 174px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eLinear regression\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 56px;\"\u003e\n \u003cp\u003e0.28\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 58px;\"\u003e\n \u003cp\u003e1.54\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 54px;\"\u003e\n \u003cp\u003e1.21\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 282px;\"\u003e\n \u003cp\u003ePredicted HbA1c levels fairly well overall and had small average errors.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 174px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eRandom forest\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 56px;\"\u003e\n \u003cp\u003e0.26\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 58px;\"\u003e\n \u003cp\u003e1.56\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 54px;\"\u003e\n \u003cp\u003e1.18\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 282px;\"\u003e\n \u003cp\u003eAlmost as good as LR but made the smallest average errors.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 174px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eSupport vector regression\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 56px;\"\u003e\n \u003cp\u003e0.19\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 58px;\"\u003e\n \u003cp\u003e1.63\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 54px;\"\u003e\n \u003cp\u003e1.26\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 282px;\"\u003e\n \u003cp\u003eDidn\u0026rsquo;t predict well and made more errors than the first two models.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 174px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eEextreme gradient boosting\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 56px;\"\u003e\n \u003cp\u003e0.07\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 58px;\"\u003e\n \u003cp\u003e1.75\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 54px;\"\u003e\n \u003cp\u003e1.30\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 282px;\"\u003e\n \u003cp\u003ePerformed poorly and made the biggest errors\u0026mdash;likely not a good model for this data.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd valign=\"top\" style=\"width: 174px;\"\u003e\n \u003cp\u003e\u003cstrong\u003eVoting regressor\u003c/strong\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 56px;\"\u003e\n \u003cp\u003e0.17\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 58px;\"\u003e\n \u003cp\u003e1.75\u003c/p\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 54px;\"\u003e\n \u003cp\u003e1.29\u003c/p\u003e\n \u003ctable border=\"0\" cellpadding=\"0\"\u003e\u003c/table\u003e\n \u003c/td\u003e\n \u003ctd valign=\"top\" style=\"width: 282px;\"\u003e\n \u003cp\u003eEnsemble model combining others; weak-moderate performance.\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n \u003ctd colspan=\"5\" valign=\"top\"\u003e\n \u003cp\u003e\u003cem\u003eR\u003csup\u003e2\u003c/sup\u003e; Coefficient of determination, RMSE; root mean squared error, MAE; mean absolute error\u003c/em\u003e\u003c/p\u003e\n \u003c/td\u003e\n \u003c/tr\u003e\n \u003c/tbody\u003e\n \u003c/table\u003e\n\u003c/div\u003e"}],"fulltextSource":"","fullText":"","funders":[],"hasAdminPriorityOnWorkflow":false,"hasManuscriptDocX":true,"hasOptedInToPreprint":true,"hasPassedJournalQc":"","hasAnyPriority":false,"hideJournal":true,"highlight":"","institution":"","isAcceptedByJournal":false,"isAuthorSuppliedPdf":false,"isDeskRejected":"","isHiddenFromSearch":false,"isInQc":false,"isInWorkflow":false,"isPdf":false,"isPdfUpToDate":true,"isWithdrawnOrRetracted":false,"journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true},"keywords":"Linear Regression, Machine Learning, Model Performance, Diabetes, Glycemic Control, SHapley Additive exPlanations","lastPublishedDoi":"10.21203/rs.3.rs-7292468/v1","lastPublishedDoiUrl":"https://doi.org/10.21203/rs.3.rs-7292468/v1","license":{"name":"CC BY 4.0","url":"https://creativecommons.org/licenses/by/4.0/"},"manuscriptAbstract":"\u003cp\u003e\u003cb\u003eBackground\u003c/b\u003e\u003c/p\u003e\u003cp\u003eThis study aimed to compare the predictive performance of linear regression (LR) versus other machine learning (ML) models and assess the importance of clinical, biochemical and medication adherence predictors using SHapley Additive exPlanations (SHAP) analysis.\u003c/p\u003e\u003cp\u003e\u003cb\u003eMethods\u003c/b\u003e\u003c/p\u003e\u003cp\u003eA cross-sectional study was conducted among adults (\u0026ge;\u0026thinsp;18 years) with type 2 diabetes mellitus (T2DM) and uncontrolled glycated hemoglobin (HbA1c) (\u0026ge;\u0026thinsp;7%), which was the primary outcome. After data preprocessing and feature selection, four supervised regression models; LR, random forest (RF), support vector regression (SVR), and extreme gradient boosting (XGBoost), were trained and evaluated. ANOVA F-test identified the top predictive continuous variables and SHAP analysis was used for clinical interpretation.\u003c/p\u003e\u003cp\u003e\u003cb\u003eResults\u003c/b\u003e\u003c/p\u003e\u003cp\u003eData from 223 patients were analyzed (mean age: 57.4\u0026thinsp;\u0026plusmn;\u0026thinsp;9.8 years; 50.7% female). LR achieved the highest coefficient of determination (R\u0026sup2;=0.28), while RF had the lowest mean absolute error (MAE\u0026thinsp;=\u0026thinsp;1.18). SVR and XGBoost underperformed, with R\u0026sup2; values of 0.19 and 0.07, respectively. Key predictors for high HbA1c included; fasting blood glucose (FBG), diastolic blood pressure (DBP), body mass index (BMI), insulin dose, serum magnesium concentration, and medication adherence. SHAP analysis confirmed the influence of DBP, FBG, insulin dose, magnesium levels, and low adherence on elevated HbA1c.\u003c/p\u003e\u003cp\u003e\u003cb\u003eConclusion\u003c/b\u003e\u003c/p\u003e\u003cp\u003eAlthough RF model moderately predicted HbA1c, LR outperformed the other ML-models. SHAP analysis highlighted interpretable predictors, supporting the use of explainable ML models for personalized glycemic risk stratification and clinical decision-making in T2DM management. Future studies should consider larger, multi-center datasets with more features and external validation to enhance ML-models\u0026rsquo; predication accuracy and generalizability.\u003c/p\u003e","manuscriptTitle":"Comparative Performance of Linear Regression and Machine Learning Models for Predicting Glycemic Status in Uncontrolled Type 2 Diabetes: SHAP-Based Analysis","msid":"","msnumber":"","nonDraftVersions":[{"code":1,"date":"2025-09-11 12:24:28","doi":"10.21203/rs.3.rs-7292468/v1","editorialEvents":[{"type":"communityComments","content":0}],"status":"published","journal":{"display":true,"email":"[email protected]","identity":"researchsquare","isNatureJournal":false,"hasQc":true,"allowDirectSubmit":true,"externalIdentity":"","sideBox":"","snPcode":"","submissionUrl":"/submission","title":"Research Square","twitterHandle":"researchsquare","acdcEnabled":true,"dfaEnabled":false,"editorialSystem":"","reportingPortfolio":"","inReviewEnabled":false,"inReviewRevisionsEnabled":true}}],"origin":"","ownerIdentity":"2fa84514-e9a0-4ad1-a39c-a9848a8df9a2","owner":[],"postedDate":"September 11th, 2025","published":true,"recentEditorialEvents":[],"rejectedJournal":[],"revision":"","amendment":"","status":"posted","subjectAreas":[],"tags":[],"updatedAt":"2026-04-08T09:50:27+00:00","versionOfRecord":[],"versionCreatedAt":"2025-09-11 12:24:28","video":"","vorDoi":"","vorDoiUrl":"","workflowStages":[]},"version":"v1","identity":"rs-7292468","journalConfig":"researchsquare"},"__N_SSP":true},"page":"/article/[identity]/[[...version]]","query":{"redirect":"/article/rs-7292468","identity":"rs-7292468","version":["v1"]},"buildId":"8U1c8b4HqxoKbykW_rLl7","isFallback":false,"isExperimentalCompile":false,"dynamicIds":[84888],"gssp":true,"scriptLoader":[]}

Text is read by the "Ask this paper" AI Q&A widget below. Extraction quality varies by source — PMC NXML preserves structure cleanly, OA-HTML may include some navigation residue, and OA-PDF can have broken hyphenation. The publisher copy (via DOI) is the canonical version.

My notes (saved in your browser only)

Ask this paper AI returns verbatim quotes from the full text · source: preprint-html

Answers must be backed by verbatim quotes from this paper's full text. Hallucinated quotes are dropped automatically; if no verbatim passage answers the question, we say so. How this works

Citation neighborhood (no data yet)

We don't have any in-corpus citations linked to this paper yet. This is a recent paper (2025) — citers typically take a year or two to land, and the OpenAlex reference graph may still be filling in.

Source provenance

europepmc
last seen: 2026-05-20T01:45:00.602351+00:00
unpaywall
last seen: 2026-05-26T02:00:01.498150+00:00
License: CC-BY-4.0