Introduction
The global population is experiencing rapid aging, with elderly patients (typically defined as ≥65 years) constituting an increasing proportion of those undergoing gastrointestinal tumor surgery.1 Postoperative recovery in this vulnerable population is often complicated by age-related physiological decline, comorbidities, and altered inflammatory responses, making the identification of factors influencing postoperative outcomes critical for optimizing care.2–4 Postoperative length of hospital stay (LOS), a key indicator of recovery, is influenced by multiple perioperative factors, yet the specific role of inflammatory cells in determining LOS in elderly patients undergoing gastrointestinal tumor surgery remains poorly understood.5
Inflammatory responses are central to surgical trauma and healing, with immune cell dynamics—particularly neutrophils, lymphocytes, and their derived biomarkers—implicated in postoperative complications such as infection, organ dysfunction, and delayed recovery.6–8 Neutrophils, the most abundant circulating leukocytes, play a dual role in inflammation: they combat pathogens but also contribute to tissue damage through excessive cytokine release.9 Previous clinical studies have linked elevated preoperative neutrophil counts or neutrophil-to-lymphocyte ratio (NLR) to worse surgical outcomes, including increased infection risk and worse survival rate, in various surgical populations.10–12 However, these associations are often inconsistent across studies, and few have specifically focused on elderly patients, who exhibit unique inflammatory profiles characterized by chronic low-grade inflammation that may modulate postoperative responses to surgery.
General anesthesia and surgical stress further perturb immune homeostasis, potentially amplifying inflammatory cascades and affecting recovery trajectories in older adults.13–15 Despite the clinical relevance of inflammatory cells in this context, traditional statistical methods struggle to model complex, high-dimensional relationships between perioperative variables and LOS. Machine learning (ML), particularly algorithms like eXtreme Gradient Boosting (XGBoost) and Least Absolute Shrinkage and Selection Operator Regression (LASSO), offers a powerful framework for identifying non-linear associations and prioritizing key predictors in large, heterogeneous datasets.16–18 These techniques have shown promise in predicting postoperative outcomes, such as complications and mortality,19–21 however their application to investigate inflammatory correlates of LOS in elderly gastrointestinal surgery patients remains under-discovered.
Against this backdrop, the present study aimed to leverage ML approaches to identify inflammatory-related factors associated with rapid versus delayed discharge in elderly patients undergoing gastrointestinal tumor resection. By integrating LASSO for variable selection, XGBoost for predictive modeling, and SHAP for interpretability, we sought to delineate the nuanced contributions of inflammatory cells to postoperative recovery in this understudied population. Findings from this study may inform the development of targeted inflammatory biomarkers for risk stratification and personalized perioperative management, ultimately improving outcomes for elderly patients undergoing major gastrointestinal surgery.
Methods
Study Design and Data Source
This retrospective cohort study included elderly patients (aged ≥65 years) who underwent gastrointestinal tumor resection under general anesthesia at a tertiary hospital between January 1, 2019, and August 31, 2023. This study adhered to the Declaration of Helsinki and received approval from the Ethics Committee of the Eighth affiliated Hospital, Sun Yat-sen University (Ethics No. 2023–077-01). Given the retrospective nature of this study, which analyzed de-identified existing clinical data without direct intervention or participant contact, the Ethics Committee waived written informed consent. To protect privacy and confidentiality, all personal identifiers (eg, names, medical record numbers) were permanently removed, rendering the data fully anonymized.
The inclusion required sufficient perioperative data, including demographics, preoperative laboratory values (such as neutrophil count, hemoglobin, creatinine), intraoperative parameters (like operative time, blood loss, fluid input, urine output), and postoperative outcomes (eg, length of hospital stay [LOS]), to be available for extraction from electronic medical records (EMR) and the anesthesia system. Patients were excluded if they had incomplete key data that could not be rectified or supplemented through manual review and validation against clinical records. Those who underwent non – gastrointestinal tumor surgeries, did not receive general anesthesia or were younger than 65 years were also excluded from the study (Figure S-1). Data were systematically cleaned to correct inconsistencies and missing values through manual review and validation. Based on the results of the normality test, continuous variables were presented as mean ± standard deviation if they followed a normal distribution, or as median (interquartile range) if they did not. Categorical variables were presented as percentages.
Outcome Definition
Postoperative LOS was defined as the number of days from surgery to discharge. To create a binary outcome for predictive modeling, patients were stratified into two groups based on the interquartile range (IQR) of LOS: rapid discharge group (LOS < 7 days, below the 25th percentile) and delayed discharge group (LOS > 12 days, above the 75th percentile). Patients with LOS between 7 and 12 days were not analyzed in the binary analysis to focus on extreme discharge trajectories.
Variable Selection with LASSO Regression
A total of 32 candidate variables, including demographic characteristics (age, sex), preoperative laboratory markers (neutrophil percentage, hemoglobin, creatinine), and intraoperative metrics (operative time, blood loss, fluid input, urine output), were initially considered. LASSO regression was applied to reduce dimensionality and identify a parsimonious set of predictors. Variables with non-zero coefficients in the final LASSO model were retained for subsequent modeling.
XGBoost Modeling
An extreme gradient boosting (XGBoost) classifier was used to model the association between selected variables and discharge status (rapid vs delayed). The model was trained on a randomly split dataset (80% training, 20% testing) to evaluate generalizability. Model performance was assessed using accuracy, precision, recall, and the area under the receiver operating characteristic curve (ROC).
Interpretability with SHAP Analysis
SHAP (SHapley Additive exPlanations) was used to interpret the XGBoost model by quantifying the marginal contribution of each feature to individual predictions. Three visualizations were generated:
Summary Plot: A global overview of feature importance, showing the distribution of SHAP values for each feature and their relationship with the outcome.
Waterfall Plot: A case-specific visualization illustrating how individual feature values contributed to the prediction of rapid or delayed discharge for a representative patient.
Dependence Plot: A local analysis depicting how SHAP values for key inflammatory features varied with their respective feature values, revealing non-linear relationships or interactions with other features.
Statistical Software
The data were managed and initially analyzed using SPSS software (version 24.0). Data preprocessing and statistical analyses were further performed in Python (version 3.7) using libraries including pandas, scikit-learn, xgboost, and SHAP. All statistical tests were two-sided, and a p-value < 0.05 was considered statistically significant.
Results
Baseline Characteristics of Patients
Table 1 summarizes the baseline demographics, comorbidities, preoperative laboratory values, and perioperative parameters of 300 elderly patients who underwent gastrointestinal tumor resection. The mean age was 72 ± 6.4 years, with males comprising 58.7% (n=176) of the cohort. The median postoperative length of hospital stay (LOS) was 9 days (IQR: 7–12 days), serving as the primary outcome for subsequent analyses. Table 2 presents preoperative and postoperative values for peripheral blood inflammatory cells, along with their absolute differences (postoperative − preoperative) and ratio (postoperative/preoperative). Median preoperative WBC was 6.2 (IQR: 5.2–7.7) ×109/L, increasing to 10.3 (8.3–12.6) ×109/L postoperatively, with a median difference of 3.6 (1.7–6.3) ×109/L and ratio of 1.6 (1.3–2.0), reflecting a robust postoperative leukocytosis. Mean preoperative LYM% was 24.5 ± 9.5%, dropping to 10.4 ± 6.0% postoperatively.
Table 1 Baseline Characteristics of Patients
Table 2 Inflammatory Biomarkers Alteration
Model performance was shown in Table S-1. Figure 1A is a SHAP (SHapley Additive exPlanations) summary plot that visualizes the relationship between individual feature values and their impact on the model’s prediction of rapid discharge (LOS < 7 days). Longer surgery durations (red dots) predominantly cluster on the negative side of the SHAP value axis, indicating that increased surgery time reduces the probability of rapid discharge. The SHAP dependence plot (Figure 1B) depicts the relationship between the preoperative neutrophil percentage (Pre_NEU%) and its impact on the prediction of rapid discharge. As Pre_NEU% increases from approximately 60% to 70%, there are notable high SHAP values (positive values indicate a greater promotion of rapid discharge), suggesting that within this range, higher preoperative neutrophil percentages are more strongly associated with an increased likelihood of rapid discharge.
Figure 1 SHAP summary plot (A) visualizes the impact of each feature on the model output. Each dot represents a data point, where the position on the x – axis (SHAP value) indicates the impact on the model output (positive values increase the likelihood of rapid discharge, negative values decrease it). The color of each dot reflects the feature’s value (red = high, blue = low). SHAP dependence plot (B) illustrating the relationship between the preoperative neutrophil percentage (Pre_NEU(%)) and its corresponding SHAP value, which quantifies the feature’s impact on the model output. Pre_NEU indicates the preoperative percent of neutrophils; Pre_HGB indicates preoperative hemoglobin.
Figure 2A illustrates the relationship between features and their impact on predicting delayed discharge (LOS > 12 days). Figure 2B is a SHAP waterfall plot, which visualizes how individual features contribute to the prediction of a specific instance (delayed discharge in this context). The SHAP dependence plot (Figure 2C) reveals a non – linear trend for the impact of the change in neutrophil percentage (Post – Pre_NEU%) on delayed discharge. Patients with neutrophil count differences of 5%–25% were more likely to experience delayed discharge. In Figure 2D, as Pre_NEU(%) increases further (70–80%), positive SHAP values become more prominent, meaning higher preoperative neutrophil percentages in this range enhance the likelihood of delayed discharge.
Figure 2 SHAP summary plot (A) visualizes the impact of each feature on the model output.SHAP waterfall plot (B) visualizes the contribution of each feature to a specific model prediction. Each horizontal bar represents a feature, with the feature name and value labeled on the left. The color of the bar indicates the direction of the feature’s impact: red signifies a positive contribution to the prediction, while blue indicates a negative contribution. The length of the bar corresponds to the magnitude of the SHAP value, which is also numerically labeled on the right. SHAP dependence plot (C) and plot (D) respectively illustrate the relationship between the preoperative neutrophil percentage (Pre_NEU(%)) and its corresponding SHAP value, as well as the relationship between Post – Pre_NEU(%) and its corresponding SHAP value. Pre_NEU indicates the preoperative percent of neutrophils; Pre_HGB indicates preoperative hemoglobin; Post – Pre_NEU(%) indicates the absolute difference between the postoperative and preoperative neutrophil percentages.
Discussion
This study aimed to investigate the impact of inflammatory cells on postoperative length of hospital stay (LOS) in elderly patients undergoing gastrointestinal tumor surgery. The findings highlight significant associations between neutrophil – related parameters and rapid or delayed discharge, underscoring the critical role of inflammatory responses in postoperative recovery.
Neutrophils, which are central to the inflammatory cascade, serve as a barometer for both the baseline inflammatory state and the body’s response to surgical stress.9 An elevated Pre_NEU% may be indicative of pre – existing subclinical inflammation or “inflammaging.” Inflammaging, a condition of chronic low – grade inflammation prevalent in the elderly, is closely associated with the dysregulation of the immune system and the cytokine network.22 In our study, the preoperative neutrophil percentage (Pre_NEU(%)), as depicted in the plot (Figure 1B), reveals a notable pattern: as Pre_NEU(%) increases from approximately 60% to 70%, there is a concentration of high SHAP values (positive values), indicating that within this specific range, higher preoperative neutrophil percentages are strongly associated with an increased likelihood of rapid discharge. This finding underscores the nuanced role of preoperative neutrophils in predicting outcomes, emphasizing that moderate levels within this specific range act as a favorable biomarker for rapid discharge in this patient population.
However, when Pre_NEU(%) is in the range of 70% to 80%, SHAP values exhibit significant positivity, strongly associating elevated preoperative neutrophil percentages with an increased likelihood of delayed discharge (Figure 2D). This trend underscores the critical role of preoperative neutrophil levels in shaping postoperative outcomes. Elevated Pre_NEU(%) may reflect underlying inflammatory states or immunosenescence, disrupting tissue repair and fostering complications that prolong hospital stay. The plot thereby identifies preoperative neutrophil percentage as a pivotal biomarker for pinpointing patients at risk of delayed discharge, emphasizing the urgency for targeted interventions—such as anti – inflammatory strategies—in those with higher Pre_NEU(%) to mitigate adverse inflammatory responses and enhance postoperative recovery.
In the SHAP plot Figure 2A, the feature “Post – Pre_NEU(%)” reveals a critical relationship with delayed discharge. As shown in the distribution of dots for this feature, higher values (represented by red dots, indicating a “high” feature value) predominantly cluster toward negative SHAP values. This indicates that significant increases in neutrophil percentage postoperatively are negatively associated with delayed discharge. Furthermore, a notable nonlinear trend emerges in the dependence plot Figure 2C: when Post – Pre_NEU(%) ranges from approximately 5% to 25%, positive SHAP values are prominently observed, indicating that moderate increases in neutrophil percentage postoperatively strongly linked to delayed discharge. This suggests that an attenuated inflammatory response level may reflect insufficient immune activation, failing to trigger protective mechanisms and fostering an anti-inflammatory microenvironment that hinders recovery.23 When the percentage change in neutrophil count from preoperative to postoperative levels exceeds 25%, this change exhibits a negative association with delayed discharge. This suggests that a postoperative neutrophil increase of over 25% relative to the preoperative value may exert a protective effect on patients, reducing the likelihood of delayed discharge. This nonlinear association underscores the complex role of neutrophil dynamics in postoperative outcomes, highlighting that postoperative neutrophil percentage increases within this specific range are critical determinants of delayed discharge, likely due to imbalanced inflammatory signaling and impaired tissue repair mechanisms.
Beyond the influence of neutrophils, for rapid discharge (Figure 1A), longer surgery durations (red dots clustering on the negative SHAP value axis) significantly reduce the probability of rapid discharge, highlighting the detrimental impact of prolonged surgical trauma on recovery timelines.24 In line with previous study,25 Age also plays a role, with higher ages (red dots) tending to associate with lower chances of rapid discharge, reflecting the challenges of aging on postoperative resilience. For delayed discharge (Figure 2A), age emerges as a prominent factor, with higher ages (more red dots) strongly contributing to delayed outcomes, underscoring age – related vulnerabilities such as immunosenescence and reduced regenerative capacity. Preoperative hemoglobin and blood loss also show a pattern that impact postoperative recovery, which has been widely validated in previous studies and do not need further comment.26–28 These visualizations collectively reveal that multiple clinical factors—surgical, age – related, and laboratory – based—interact to shape postoperative outcomes, beyond neutrophil – specific metrics, providing a comprehensive view of risks influencing rapid or delayed discharge in elderly gastrointestinal tumor resection patients.
However, this study has limitations. As a retrospective analysis, it is subject to inherent biases. Additionally, only neutrophil percentages were analyzed, neglecting other inflammatory markers (eg, cytokines, chemokines) that might contribute to LOS. Future studies with larger, prospective cohorts and comprehensive inflammatory profiling could deepen our understanding of these relationships.
In conclusion, this study demonstrates that inflammatory cell parameters, particularly neutrophil – related metrics, significantly impact postoperative LOS in elderly gastrointestinal tumor surgery patients. These findings underscore the importance of integrating inflammatory status into perioperative assessment and management, offering a promising avenue for improving outcomes in this vulnerable population.
Data Sharing Statement
The datasets analyzed during the current study are available from the corresponding author upon reasonable request.
Ethics Approval and Consent to Participate
This study was approved by the Ethics Committee (Approval No.: 2023-077-01) of the Eighth Affiliated Hospital, Sun Yat-sen University. As this is a retrospective study, informed consent from patient was waived by Ethics Committee (Approval No.: 2023-077-01) of the Eighth Affiliated Hospital of Sun Yat-sen University.
Author Contributions
Jing Liu, Yubang Hu and Xiaoxuan Zhan contributed equally to this work and should be considered as co-first authors. All authors made a significant contribution to the work reported, whether that is in the conception, study design, execution, acquisition of data, analysis and interpretation, or in all these areas: Cai Li and Jing Liu conceived and designed the study; Jing Liu and Yubang Hu collected and analyzed the data. All authors took part in drafting, revising or critically reviewing the article: Jing Liu wrote the first draft of the paper, and Xiaoxuan Zhan and Huanwei Wang contributed to the writing and revision. All authors gave final approval of the version to be published, have agreed on the journal to which the article has been submitted, and agree to be accountable for all aspects of the work.
Funding
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.
Disclosure
The authors certify that there is no conflict of interest with any financial organization regarding the material discussed in the paper.
References
1. CE C, Samost-Williams A, Philpotts L, et al. Geriatric assessment in colorectal surgery: a systematic review. J Surg Res. 2024;296:720–734. doi:10.1016/j.jss.2023.12.055
2. Jones S, Moore JT, Robinson TN. Perioperative care strategy for older adults. Med Clin North Am. 2020;104(5):895–908. doi:10.1016/j.mcna.2020.06.010
3. Tahiri M, Sikder T, Maimon G, et al. The impact of postoperative complications on the recovery of elderly surgical patients. Surg Endosc. 2016;30(5):1762–1770. doi:10.1007/s00464-015-4440-2
4. Turrentine FE, Wang H, Simpson VB, et al. Surgical risk factors, morbidity, and mortality in elderly patients. J Am College Surg. 2006;203(6):865–877. doi:10.1016/j.jamcollsurg.2006.08.026
5. Moyes LH, Leitch EF, Mckee RF, et al. Preoperative systemic inflammation predicts postoperative infectious complications in patients undergoing curative resection for colorectal cancer. Br. J. Cancer. 2009;100(8):1236–1239. doi:10.1038/sj.bjc.6604997
6. Alsaif SH, Rogers AC, Pua P, et al. Preoperative C-reactive protein and other inflammatory markers as predictors of postoperative complications in patients with colorectal neoplasia. World J Surg Oncol. 2021;19(1):74. doi:10.1186/s12957-021-02142-4
7. Alam A, Hana Z, Jin Z, et al. Surgery, neuroinflammation and cognitive impairment. EBioMedicine. 2018;37:547–556. doi:10.1016/j.ebiom.2018.10.021
8. Ginesu GC, Paliogiannis P, Feo CF, et al. Inflammatory indexes as predictive biomarkers of postoperative complications in oncological thoracic surgery. Curr Oncol. 2022;29(5):3425–3432. doi:10.3390/curroncol29050276
9. Romeo C, Cruccetti A, Turiaco A, et al. Monocyte and neutrophil activity after minor surgical stress. J Pediatric Surg. 2002;37(5):741–744. doi:10.1053/jpsu.2002.32268
10. Zahorec R. Neutrophil-to-lymphocyte ratio, past, present and future perspectives. Bratisl Lek Listy. 2021;122(7):474–488. doi:10.4149/BLL_2021_078
11. Shevchenko I, Grigorescu C, Serban D, et al. The value of systemic inflammatory indices for predicting early postoperative complications in colorectal cancer. Medicina. 2024;60(9):1481. doi:10.3390/medicina60091481
12. Urbanowicz T, Olasińska-Wiśniewska A, Michalak M, et al. The prognostic significance of Neutrophil to Lymphocyte Ratio (NLR), Monocyte to Lymphocyte Ratio (MLR) and Platelet to Lymphocyte Ratio (PLR) on Long-Term Survival in Off-Pump Coronary Artery Bypass Grafting (OPCAB) Procedures. Biology. 2021;11(1):34. doi:10.3390/biology11010034
13. Cruz FF, Rocco PR, Pelosi P. Anti-inflammatory properties of anesthetic agents. Critical Care. 2017;21(1):67. doi:10.1186/s13054-017-1645-x
14. Margraf A, Ludwig N, Zarbock A, et al. Systemic inflammatory response syndrome after surgery: mechanisms and protection. Anesthesia Analg. 2020;131(6):1693–1707. doi:10.1213/ANE.0000000000005175
15. Yao Y, Shao H, Masters J, et al. Cardiac surgery with valve replacement temporarily disrupts the hippocampal memory network. Br J Anaesth. 2024.
16. Ye Z, Zhu Y, Coffman DL. Variable selection for causal mediation analysis using LASSO-based methods. Statistical Methods Med Res. 2021;30(6):1413–1427. doi:10.1177/0962280221997505
17. Deo RC. Machine Learning in Medicine. Circulation. 2015;132(20):1920–1930. doi:10.1161/CIRCULATIONAHA.115.001593
18. Chen T, Guestrin C. Xgboost: reliable large-scale tree boosting system; proceedings of the Proceedings of the 22nd SIGKDD Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, F, 2015.
19. Ren Y, Loftus TJ, Datta S, et al. Performance of a machine learning algorithm using electronic health record data to predict postoperative complications and report on a mobile platform. JAMA Netw Open. 2022;5(5):e2211973. doi:10.1001/jamanetworkopen.2022.11973
20. Pera M, Gibert J, Gimeno M, et al. Machine learning risk prediction model of 90-day mortality after gastrectomy for cancer. Ann Surg. 2022;276:776–783. doi:10.1097/SLA.0000000000005616
21. Cao B, Hao P, Guo W, et al. A predictive model for blood transfusion during liver resection. Eur J Surg Oncol. 2022;48:1550–1558. doi:10.1016/j.ejso.2022.01.013
22. Franceschi C, Campisi J. Chronic inflammation (inflammaging) and its potential contribution to age-associated diseases The journals of gerontology Series A. Bio sci med sci. 2014;69(Suppl 1):S4–9. doi:10.1093/gerona/glu057
23. Leliefeld PH, Wessels CM, Leenen LP, et al. The role of neutrophils in immune dysfunction during severe inflammation. Critical Care. 2016;20:73. doi:10.1186/s13054-016-1250-4
24. Cheng H, Clymer JW, Po-Han C, et al. Prolonged operative duration is associated with complications: a systematic review and meta-analysis. J Surg Res. 2018;229:134–144. doi:10.1016/j.jss.2018.03.022
25. Polanczyk CA, Marcantonio E, Goldman L, et al. Impact of age on perioperative complications and length of stay in patients undergoing noncardiac surgery. Ann Int Med. 2001;134(8):637–643. doi:10.7326/0003-4819-134-8-200104170-00008
26. Wu WC, Schifftner TL, Henderson WG, et al. Preoperative hematocrit levels and postoperative outcomes in older patients undergoing noncardiac surgery. JAMA. 2007;297(22):2481–2488. doi:10.1001/jama.297.22.2481
27. Hallward G, Balani N, Mccorkell S, et al. The relationship between preoperative hemoglobin concentration, use of hospital resources, and outcomes in cardiac surgery. J Cardiothoracic Vascular Anesthesia. 2016;30(4):901–908. doi:10.1053/j.jvca.2016.02.004
28. Mastracci TM, Bhandari M, Mundi R, et al. Operative blood loss, blood transfusion and 30-day mortality in older patients after major noncardiac surgery. Can J Surg J Canadien de Chirurgie. 2012;55(6):426–428. doi:10.1503/cjs.025212