Abstract
The purpose of this study was to develop a machine learning model for predicting 30-day readmission after bariatric surgery based on laboratory tests. Data were collected from patients who underwent bariatric surgery between 2018 and 2023. Laboratory test indicators from the preoperative stage, one day postoperatively, and three days postoperatively were analyzed. Least absolute shrinkage and selection operator regression was used to select the most relevant features. Models constructed included support vector machine (SVM), generalized linear model, multi-layer perceptron, random forest, and extreme gradient boosting. Model performance was evaluated and compared using the area under the receiver operating characteristic curve (AUROC). A total of 1262 patients were included, of which 7.69% of cases were readmitted. The SVM model achieved the highest AUROC (0.784; 95% CI 0.696–0.872), outperforming other models. This suggests that machine learning models based on laboratory test data can effectively identify patients at high risk of readmission after bariatric surgery.
Similar content being viewed by others
Introduction
With the continuous rise in global obesity rates, it is projected that by 2025, 18% of men and 21% of women worldwide will be affected by obesity1. Bariatric surgery has been proven to achieve significant, sustained weight loss, improve various obesity-related complications, and significantly reduce mortality while increasing life expectancy2,3. The safety of bariatric surgery has been significantly enhanced due to improvements in surgical protocols and the widespread adoption of laparoscopic techniques. However, despite the significant clinical success of bariatric surgery, readmission within 30 days of surgery remains a critical issue. Previous studies have shown that all-cause readmission rates within 30 days of bariatric surgery range from 3.3% to 9.0%4,5,6,7,8. Patients who are readmitted generally experience longer hospital stays, higher mortality rates, and increased medical costs5,6,9.
With the rapid development of machine learning technologies in the medical field, an increasing number of studies are using these technologies to predict complications after bariatric surgery, such as postoperative gastrointestinal bleeding, leaks, and venous thromboembolism10,11. The occurrence of these complications is closely related to readmission within 30 days post-operation12. Specific laboratory tests have been identified as predictors of early postoperative complications. Preoperative serum albumin levels are associated with severe complications, readmissions, and mortality rates after bariatric surgery13. Elevated postoperative levels of C-reactive protein and procalcitonin are indicators of increased risk for septic complications and postoperative suture leakage14,15,16. Nevertheless, there are currently no studies predicting the 30-day readmission rates post-bariatric surgery based on these indicators. This study aims to develop a machine learning model that utilizes laboratory test markers to precisely predict the risk of 30-day readmission after bariatric surgery. It seeks to facilitate the development of personalized postoperative management strategies and enhance patient outcomes.
Methods
Data source
Patients who underwent initial bariatric surgery at the Department of Pancreatic and Metabolic Surgery of Nanjing Drum Tower Hospital from January 2018 to December 2023 were included in this study. All patients were those undergoing their initial bariatric surgery. Patients who were readmitted after revision surgery were excluded. All patient data were sourced from the Nanjing Drum Tower Hospital Bariatric and Metabolic Database and medical records. All surgeries and post-operative care are carried out by the same experienced team. Standardized post-operative management is used for all patients. In principle, all patients can be discharged after blood tests on the third post-operative day. Baseline demographic characteristics (age, gender, body mass index) were included in the study. Surgery types included laparoscopic sleeve gastrectomy (LSG), Roux-en-Y gastric bypass (RYGB), one-anastomosis gastric bypass (OAGB), one-anastomosis transit bipartition (OATB), single-anastomosis sleeve jejunal bypass (SASJ), laparoscopic sleeve gastrectomy plus jejunojejunal bypass (LSG-JJB), laparoscopic sleeve gastrectomy plus transit bipartition (LSG-TB). The duration of surgery is also included. In addition, the study involved testing several biomarkers at different time points. Glycosylated hemoglobin A1c(HbA1c) and prealbumin (PA) were measured preoperatively. Other biomarkers, including procalcitonin (PCT), white blood cell count (WBC), red blood cell count (RBC), hemoglobin (Hb), C-reactive protein (CRP), albumin (ALB), alanine aminotransferase (ALT), aspartate aminotransferase (AST), uric acid (UA), and interleukin-6 (IL6), were measured both preoperatively and on postoperative days 1 and 3. The endpoint of the study was unplanned readmission for any reason within 30 days after surgery. The study was approved by the Ethics Committee of Nanjing Drum Tower Hospital (Ethics No. 2023-607-01), and informed consent was obtained from all participants. All study methods followed the Declaration of Helsinki and relevant guidelines and regulations.
Data processing
During the data processing and variable selection phase, we first evaluated the dataset for missing data. We excluded any variable that had more than 20% missing data to maintain the quality of our dataset. Subsequently, we randomly divided the data into training and testing sets using a 7:3 ratio. The training set was dedicated to model development, and the testing set was used solely for the final model performance evaluation. To handle missing values in the training set, we employed k-nearest neighbor imputation. This method estimates missing values by leveraging similarities among the nearest neighboring data points, thereby aiming to preserve the natural distribution and inherent characteristics of the data.
Feature selection
To select the most significant variables from a pool of potential predictors, we implemented least absolute shrinkage and selection operator (LASSO) regression. This approach facilitates variable selection by applying a regularization parameter, λ, which shrinks the coefficients of less crucial variables towards zero. This not only simplifies the model but also enhances its interpretability by retaining only the most predictive variables. We determined the optimal value of λ through tenfold cross-validation.
Model development and evaluation
To construct the prediction models, we selected multiple machine learning techniques including random forest (RF), extreme gradient boosting (XGB), generalized linear models (GLM), support vector machines (SVM), and multi-layer perceptron (MLP). All models were constructed via the R package caret. To address significant category imbalance in our dataset, we utilized the R package ROSE, employing a hybrid sampling technique that oversamples the minority class and undersamples the majority class, thus creating a more balanced dataset. We employ tenfold cross-validation to maximize data utilization and ensure that each sample contributes to both the training and validation processes. In addition, parameter tuning of the model is accomplished through a stochastic hyperparameter search to find the optimal model configuration. Model performance was primarily assessed using the area under the receiver operating characteristic curve (AUROC), which effectively summarizes the model's capability to discriminate between positive and negative cases. The AUROC values ranged from 0.5 (equivalent to random guessing) to 1.0 (indicating perfect classification). Considering the category imbalance, we also used other assessment metrics such as balanced accuracy, F1 score, and Matthews correlation coefficient (MCC) to fully evaluate the model performance. All model development steps, including data normalization, feature selection, and hyperparameter optimization, were performed only on the training set to avoid information leakage from the test set.
Statistical analysis
Data analysis was performed using R software, version 4.3.3. Descriptive statistics for normally distributed continuous variables are presented as means with standard deviations (SD), and for non-normally distributed continuous variables as medians with interquartile ranges (IQR). Categorical variables are described using frequencies and proportions. For inferential statistics, we used the Wilcoxon rank sum test for continuous variables and the chi-squared test or Fisher's exact test for categorical variables. We considered a p-value of less than 0.05 to indicate statistical significance.
Results
Patient characteristics and reasons for readmission
According to our inclusion criteria, 1262 participants were enrolled and randomly assigned to a training group (n = 883) and a test group (n = 379) (Supplementary Table 1). The overall 30-day readmission rate was 7.69% (Table 1). The median age of the patients was 31 years, and the median body mass index was 39 kg/m2, with females comprising 64% of the participants. LSG surgery accounted for 83% of all surgeries, followed by OAGB (5.4%), OATB (3.5%), RYGB (2.9%), SASJ (2.4%), LSG-JJB (1.9%), and LSG-TB (1.0%). The highest readmission rate was observed for LSG-TB (16.7%, 2/12), followed by RYGB (8.3%, 3/36), LSG-JJB (8.3%, 2/24), LSG (8.1%, 85/1048), OATB (6.8%, 3/44), SASJ (3.3%, 1/30) and OAGB (1.5%, 1/68). Nevertheless, the findings of the Fisher's exact test indicated that there was no statistically significant difference in the rates of readmission between the various procedures. Readmitted patients exhibited lower RBC levels preoperatively, as well as on postoperative days 1 and 3, compared to those who were not readmitted. Additionally, their CRP levels were elevated on postoperative days 1 and 3, and UA levels increased on postoperative day 3.
A total of 97 patients were readmitted within 30 days postoperatively (Table 2). More than one reason for readmission can be registered per patient. The most common reason for readmission was nausea, vomiting, and dehydration, affecting 47 patients (48.5%). This was followed by infections in 20 patients (20.6%), anastomotic leakage in 17 (17.5%), abdominal symptoms in 8 (8.2%), and fever in 7 (7.2%).
Characterization variable screening.
Six non-zero characteristic variables were utilized as predictors in LASSO regression through cross-validation (Fig. 1 A, B). The selected variables included preoperative HbA1c, WBC, RBC, CRP levels on postoperative days 1 and 3, and UA levels on postoperative day 3. (Supplementary Table 2).
Model comparison
All five machine learning models demonstrated comparable performance in terms of AUROC (Fig. 2). The SVM model exhibited slightly superior performance with an AUROC of 0.784 (95% CI 0.696–0.872), followed closely by the GLM 0.779 (95% CI 0.693–0.864), MLP 0.778 (95% CI 0.691–0.866), RF 0.751 (95% CI 0.661–0.825), and XGB 0.743 (95% CI 0.641–0.845). Furthermore, when comparing balanced accuracy, F1 score, and MCC, SVM consistently outperformed the other models in distinguishing between patient outcomes (Table 3).
Discussion
In this study, we included 1262 patients who underwent bariatric surgery. The 30-day postoperative readmission rate was 7.69%, with nausea, vomiting, and dehydration cited as the most common reasons for readmission, aligning with findings from previous studies4,18. However, there was no significant difference in readmission rates for the various procedures in our cohort. This may be attributed to the relatively low number of surgical cases other than sleeve gastrectomy in our cohort. Nevertheless, a recent randomised clinical trial on the safety of SG versus RYGB demonstrated that there was no significant difference in 30-day readmission rates after bariatric surgery17. Further research is needed on this issue to include more cases. Our study found a significantly higher proportion of patients (48.5%) readmitted for these symptoms. This discrepancy may relate to the fact that 83% of our patients underwent sleeve gastrectomy, a group more susceptible to these complications19. Furthermore, our study uniquely categorized nausea, vomiting, and dehydration as a single readmission reason, unlike other studies that separate these conditions. This classification approach likely contributed to the observed higher incidence of these symptoms.
LASSO regression identified six critical predictive variables: preoperative HbA1c, WBC, RBC, CRP on postoperative days 1 and 3, and UA on postoperative day 3. Previous studies have shown indicated that although HbA1c levels were not significantly linked to postoperative complications, they correlated with the risk of readmission20,21. Obesity-related chronic inflammation typically resulted in elevated preoperative WBC levels22. Patients with higher preoperative WBC levels were more likely to develop high WBC counts postoperatively, which is associated with an increased risk of postoperative complications23. An increase in CRP levels on postoperative day 1 was associated with the incidence of perioperative complications within 30 days postoperatively24,25,26. While CRP levels on postoperative day 1 alone were insufficient for definitive diagnosis of postoperative complications, they served effectively as exclusionary diagnostic indicators27,28. Additionally, elevated CRP levels on postoperative day 3 were instrumental in the early diagnosis of infectious complications29. Although weight loss following bariatric surgery typically leads to decreased UA levels and reduced gout attack incidence long-term, UA levels may fluctuate within the first postoperative month, often experiencing temporary increases and associated gout attacks30,31,32. Our study found that readmitted patients exhibited higher levels of CRP on postoperative days 1 and 3, and higher UA levels on postoperative day 3, compared to those not readmitted. Additionally, readmitted patients exhibited lower RBC levels both preoperatively and on postoperative days 1 and 3. Currently, there is insufficient research exploring the relationship between preoperative RBC levels and the risk of complications or readmission following bariatric surgery, necessitating further investigation.
In recent years, some studies have focused on predicting the 30-day readmission rates following bariatric surgery. One study employed the Metabolic and Bariatric Surgery Accreditation and Quality Improvement Program (MBSAQIP) data from 2016 to establish a logistic regression model, achieving an AUROC of 0.6133. In addition to traditional regression models, some studies have used machine learning models for prediction, which outperform logistic regression. A study utilizing MBSAQIP data from 2015 to 2018 developed a model using the 'Super Learner' algorithm, which achieved an AUROC of 0.674, surpassing the logistic regression model’s AUROC of 0.65034. Among these predictive models, the XGB model constructed in the study by Logan R Butler et al, performed the best with an AUROC of 0.785, while the logistic regression model had an AUROC of only 0.6235. Furthermore, the study highlighted that including preoperative, intraoperative, and postoperative variables significantly enhances model effectiveness over those models limited to preoperative and intraoperative variables35. However, as their model encompasses all variables in the MBSAQIP prior to patient discharge, it may face challenges in external validation and clinical application. In contrast, in our study, the optimal model for predicting readmission was the SVM model, with an AUROC of 0.784. Although slightly lower than Butler's XGB model, its feasibility in clinical application is higher due to it only including six laboratory test indicators.
There are some potential limitations in this study. First, as the data originated solely from a single-center medical institution, they may lack broader representativeness. Second, the inability to assess the impact of certain factors on model performance, due to missing data and the exclusion of relevant outcome variables like surgical procedure and BMI during screening, led to a model reliant solely on laboratory test results. More predictor variables could be included in the future to improve the performance of the predictive model. Additionally, despite dataset segmentation and cross-validation, the model still risks potential overfitting. Therefore, testing the model on an external independent dataset is essential to further evaluate its performance. Finally, the novel coronavirus pandemic during the data collection period may have influenced patient readmission behavior.
Conclusion
In summary, this study introduces the first machine learning model that utilizes laboratory examination data to predict readmissions following bariatric surgery. The model provides clinicians with a novel tool for identifying patients at high risk of readmission 30 days after bariatric surgery.
Data availability
The datasets used/analyzed in the current study are available from corresponding authors on reasonable request.
References
NCD Risk Factor Collaboration (NCD-RisC). Trends in adult body-mass index in 200 countries from 1975 to 2014: a pooled analysis of 1698 population-based measurement studies with 19·2 million participants. Lancet 387(10026), 1377–1396 (2016).
Courcoulas, A. P., Daigle, C. R. & Arterburn, D. E. Long term outcomes of metabolic/bariatric surgery in adults. BMJ 383, e071027 (2023).
Carlsson, L. M. S. et al. Life expectancy after bariatric surgery in the Swedish obese subjects study. N. Engl. J. Med. 383(16), 1535–1543 (2020).
Aman, M. W., Stem, M., Schweitzer, M. A., Magnuson, T. H. & Lidor, A. O. Early hospital readmission after bariatric surgery. Surg. Endosc. 30(6), 2231–2238 (2016).
Sharma, S. et al. Rates and predictors of 30-day readmissions in patients undergoing bariatric surgery in the US: A nationwide study. Obes. Surg. 31(1), 62–69 (2021).
Argueta, P. P. et al. Thirty-day readmission after bariatric surgery: Causes, effects on outcomes, and predictors. Dig. Dis. Sci. 67(3), 834–843 (2022).
Vierra, B. M., Edgerton, C. A. & Shikora, S. A. The impact of procedure type on 30-day readmissions following metabolic and bariatric surgery: postoperative complications of bariatric surgery. Surg. Endosc. 37(3), 2127–2132 (2023).
Hong, B. et al. Factors associated with readmission after laparoscopic gastric bypass surgery. Surg. Obes. Relat. Dis. 8(6), 691–695 (2012).
Chhabra, K. R. et al. Relationship between health care spending and clinical outcomes in bariatric surgery: Implications for medicare bundled payments. Ann. Surg. 275(2), 356–362 (2022).
Hsu, J. L. et al. Application of machine learning to predict postoperative gastrointestinal bleed in bariatric surgery. Surg. Endosc. 37(9), 7121–7127 (2023).
Nudel, J. et al. Development and validation of machine learning models to predict gastrointestinal leak and venous thromboembolism after weight loss surgery: an analysis of the MBSAQIP database. Surg. Endosc. 35(1), 182–191 (2021).
Garg, T., Rosas, U., Rivas, H., Azagury, D. & Morton, J. M. National prevalence, causes, and risk factors for bariatric surgery readmissions. Am. J. Surg. 212(1), 76–80 (2016).
McLean, C., Mocanu, V., Birch, D. W., Karmali, S. & Switzer, N. J. Hypoalbuminemia predicts serious complications following elective bariatric surgery. Obes. Surg. 31(10), 4519–4527 (2021).
Kassir, R., Blanc, P., Bruna Tibalbo, L. M., Breton, C. & Lointier, P. C-Reactive protein and procalcitonin for the early detection of postoperative complications after sleeve gastrectomy: preliminary study in 97 patients. Surg. Endosc. 29(6), 1439–1444 (2015).
Muñoz, J. L. et al. C-reactive protein and procalcitonin as early markers of septic complications after laparoscopic sleeve gastrectomy in morbidly obese patients within an enhanced recovery after surgery program. J. Am. Coll. Surg. 222(5), 831–837 (2016).
Ruiz-Tovar, J. et al. C-reactive protein, fibrinogen, and procalcitonin levels as early markers of staple line leak after laparoscopic sleeve gastrectomy in morbidly obese patients within an enhanced recovery after surgery (ERAS) program. Surg. Endosc. 31(12), 5283–5288 (2017).
Hedberg, S. et al. BEST study group comparison of sleeve gastrectomy vs Roux-en-Y gastric bypass: A randomized clinical trial. JAMA Netw. Open 7(1), 2353141 (2024).
Petrick, A. et al. The readmission contradiction: toward clarifying common misconceptions about bariatric readmissions and quality improvement. Surg. Obes. Relat. Dis. 14(7), 1026–1032 (2018).
Sippey, M., Kasten, K. R., Chapman, W. H. H., Pories, W. J. & Spaniolas, K. 30-day readmissions after sleeve gastrectomy versus Roux-en-Y gastric bypass. Surg. Obes. Relat. Dis. 12(5), 991–996 (2016).
Wysocki, M. et al. Type 2 Diabetes Mellitus and preoperative HbA1c level have no consequence on outcomes after laparoscopic sleeve gastrectomy-a cohort study. Obes. Surg. 29(9), 2957–2962 (2019).
Morales-Marroquin, E. et al. Type 2 diabetes and HbA1c predict all-cause post-metabolic and bariatric surgery hospital readmission. Obes. Silv. Spring 29(1), 71–78 (2021).
Chen, S. B. et al. Serum C-reactive protein and white blood cell count in morbidly obese surgical patients. Obes. Surg. 19(4), 461–466 (2009).
Lo, H. C. & Hsu, S. C. Suggested flowchart through integrated C-reactive protein and white blood cell count analysis for screening for early complications after gastric bypass: A single-center retrospective study. Obes. Surg. 33(11), 3517–3526 (2023).
Kröll, D. et al. C-reactive protein on postoperative day 1: A predictor of early intra-abdominal infections after bariatric surgery. Obes Surg 28(9), 2760–2766 (2018).
Wysocki, M. et al. Utility of inflammatory markers in detection of perioperative morbidity after laparoscopic sleeve gastrectomy, laparoscopic roux-en-Y gastric bypass, and one-anastomosis gastric bypass-multicenter study. Obes. Surg. 30(8), 2971–2979 (2020).
Villard, M. A. et al. C-Reactive protein as a predictor of post-operative complications in bariatric surgery patients. Surg. Endosc. 33(8), 2479–2484 (2019).
Bona, D. et al. Does C-reactive protein have a predictive role in the early diagnosis of postoperative complications after bariatric surgery? Systematic review and bayesian meta-analysis. Obes. Surg. 29(11), 3448–3456 (2019).
Bona, D., Micheletto, G., Bonitta, G. & Aiolfi, A. Does C-reactive protein day 1 post-surgery have a predictive role for postoperative complications: Reply. Obes. Surg. 30(4), 1580–1581 (2020).
Lee, Y. et al. Diagnostic value of c-reactive protein levels in postoperative infectious complications after bariatric surgery: a systematic review and meta-analysis. Obes. Surg. 29(7), 2022–2029 (2019).
Yeo, C. et al. Impact of bariatric surgery on serum uric acid levels and the incidence of gout-A meta-analysis. Obes. Rev. 20(12), 1759–1770 (2019).
Nielsen, S. M. et al. Weight loss for overweight and obese individuals with gout: a systematic review of longitudinal studies. Ann. Rheum. Dis. 76(11), 1870–1882 (2017).
Lu, J. et al. Effects of bariatric surgery on serum uric acid in people with obesity with or without hyperuricaemia and gout: a retrospective analysis. Rheumatology (Oxford) 60(8), 3628–3634 (2021).
El Chaar, M., Stoltzfus, J., Gersin, K. & Thompson, K. A novel risk prediction model for 30-day severe adverse events and readmissions following bariatric surgery based on the MBSAQIP database. Surg. Obes. Relat. Dis. 15(7), 1138–1145 (2019).
Torquati, M. et al. Using the super learner algorithm to predict risk of 30-day readmission after bariatric surgery in the United States. Surgery 171(3), 621–627 (2022).
Butler, L. R. et al. Predicting readmission after bariatric surgery using machine learning. Surg. Obes. Relat. Dis. 19(11), 1236–1244 (2023).
Funding
This study was supported by the Nanjing Drum Tower Hospital Clinical Research Special Funds, Single Disease Database Construction Project (2022-LCYJ-DBZ-03) and Nanjing Drum Tower Hospital Clinical Research Special Funding Project (2024-LCYJ-PY-35).
Author information
Authors and Affiliations
Contributions
The study was conceived and designed by Xiaodong Shan and Xitai Sun. Xiaodong Shan and Xitai Sun were responsible for Supervision, Funding acquisition, Project administration. Clinical data were collected by Mingchuang Zhang, Rui Chen and Yidi Yang. Data analysis and interpretation were performed by Mingchuang Zhang. The manuscript was drafted by Mingchuang Zhang and revised by Rui Chen, Yidi Yang, Xiaodong Shan and Xitai Sun. All authors contributed to the article and agreed to submit it.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary Information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Zhang, M., Chen, R., Yang, Y. et al. Machine learning analysis of lab tests to predict bariatric readmissions. Sci Rep 14, 16845 (2024). https://doi.org/10.1038/s41598-024-67710-6
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s41598-024-67710-6
Keywords
Comments
By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.