Your new experience awaits. Try the new design now and help us make it even better

ORIGINAL RESEARCH article

Front. Med., 05 December 2025

Sec. Intensive Care Medicine and Anesthesiology

Volume 12 - 2025 | https://doi.org/10.3389/fmed.2025.1701973

This article is part of the Research TopicAdvancing Gastrointestinal Disease Diagnosis with Interpretable AI and Edge Computing for Enhanced Patient CareView all 12 articles

Machine learning–based risk stratification for gastrointestinal bleeding in ICU patients with cirrhosis: evidence from the MIMIC database


Yuxin Duan&#x;Yuxin DuanWeifan Sui&#x;Weifan SuiZefeng CaiZefeng CaiYimaoXua XiaYimaoXua XiaJianyun LiJianyun LiJianhua Fu
Jianhua Fu*
  • Department of Interventional Radiology, The Affiliated People’s Hospital of Jiangsu University, Zhenjiang, Jiangsu, China

Background: In critically ill patients with cirrhosis, gastrointestinal bleeding (GIB) is a common complication that significantly impacts clinical outcomes during ICU hospitalization. Early identification of high-risk patients is crucial for preventing complications and guiding appropriate clinical interventions, which can improve treatment outcomes.

Objective: To develop and externally validate a machine learning model for predicting in-hospital GIB in ICU patients with cirrhosis, identify key predictors, and assess its clinical utility for risk stratification and decision-making.

Methods: A retrospective cohort study was conducted, including 3,160 ICU patients diagnosed with cirrhosis from the Medical Information Mart for Intensive Care IV (MIMIC-IV) database. Patients were divided chronologically into training (n = 2,528) and testing (n = 632) cohorts based on their ICU admission dates. External validation was performed on a separate cohort of 523 ICU patients with cirrhosis extracted from the publicly available Electronic Intensive Care Unit (EICU) database. Key predictive variables were identified through a combination of the Boruta algorithm, correlation analysis, and variance inflation factor (VIF) assessment, ensuring both predictive relevance and control of multicollinearity. Six ML algorithms—logistic regression, k-nearest neighbors, support vector machine, random forest (RF), multilayer perceptron, extreme gradient boosting, and gradient boosting machine—were trained and evaluated through 10-fold cross-validation. Model performance was rigorously assessed based on the area under the receiver operating characteristic curve (AUC-ROC), accuracy, sensitivity, specificity, F1-score, calibration curves, and decision curve analysis (DCA). Shapley additive explanations (SHAP) analysis was employed to interpret and rank variable importance. Additionally, multivariable logistic regression models were constructed to elucidate the relationship between anticoagulant therapy and the incidence of in-ICU GIB after comprehensive adjustment for relevant clinical factors.

Results: Among the ML algorithms evaluated, the RF model achieved AUC of 0.86 (95% CI: 0.84–0.88) in the training cohort and 0.72 (95% CI: 0.68–0.76) in the test cohort, with sensitivity 0.68, specificity 0.71, and precision 0.47. The key predictors identified by the model included red blood cell count, hemoglobin level, platelet count, and anticoagulant therapy, all of which were significantly associated with the risk of gastrointestinal bleeding. Decision curve analysis indicated that the RF model provides meaningful clinical utility for early risk stratification. Multivariable logistic regression further revealed that anticoagulant use independently correlated with a lower risk of in-ICU GIB (or: 0.29; 95% confidence interval: 0.24–0.34). Stratified analyses based on gender, age, weight, and additional subgroups consistently confirmed the robustness of the protective association between anticoagulant therapy and reduced GIB risk.

Conclusion: The RF model demonstrated stable discrimination for predicting GIB risk in ICU patients with cirrhosis across multiple cohorts. Built on readily available clinical data, it enables timely risk stratification and informs individualized preventive interventions in critical care settings.

Introduction

Liver cirrhosis is a common outcome of chronic liver disease and remains a major contributor to global mortality and morbidity. Despite changes in its underlying causes over the past decade, cirrhosis continues to result in serious complications such as hepatic encephalopathy, ascites, variceal bleeding, and hepatocellular carcinoma, and was responsible for approximately 2.4% of all global deaths (1). Furthermore, a substantial proportion of hospitalized patients with liver cirrhosis require ICU admission, which imposes considerable economic burdens on both families and healthcare system (2, 3). GIB, a frequent complication in patients with liver cirrhosis, significantly worsens clinical outcomes and remains a major determinant of poor prognosis.

Existing studies have demonstrated a strong association between liver cirrhosis and the occurrence of GIB, particularly among patients with portal hypertension and compromised liver function (47). Among hospitalized patients with liver cirrhosis, GIB presents a major clinical challenge, often leading to treatment delays and substantially elevated in-hospital mortality. However, the underlying mechanisms of GIB in patients with liver cirrhosis remain incompletely understood. Proposed contributors include portal hypertension–related variceal rupture, anticoagulation-related mucosal injury, coagulopathy, and systemic inflammatory responses (8). Especially in patients with liver cirrhosis requiring anticoagulant and antiplatelet treatment, maintaining an optimal balance between thrombosis prevention and bleeding risk remains particularly challenging, thereby further increasing the likelihood of GIB.

Previous studies have primarily focused on identifying risk factors for upper gastrointestinal bleeding (UGIB) in patients with cirrhosis, such as ascites and spleen stiffness and other liver function–related parameters. However, some of these studies were limited by small sample sizes, lack of external validation, and insufficient consideration of time-dependent variables such as the initiation and duration of anticoagulant or antiplatelet therapy (911). ML approaches may improve risk prediction by capturing non-linear relationships not detected by traditional regression models.

This study combined machine learning approaches with traditional statistical methods to identify risk factors for GIB in cirrhotic patients after ICU admission. The primary goals were to develop and externally validate a robust predictive model and to evaluate the impact of GIB on short-term outcomes, with the goal of enabling earlier intervention in high-risk patients.

Materials and methods

This retrospective cohort study utilized data from the MIMIC-IV version 3.1 database, a large publicly available critical care dataset. The EICU database was employed for external validation to assess the generalizability of the predictive model. As a large, single-center, publicly available critical care database, the MIMIC database contains comprehensive and high-quality data on patients admitted to the intensive care units (ICUs) of Beth Israel Deaconess Medical Center (Boston, MA, United States) between 2008 and 2019 (12). This study was approved by the Institutional Review Boards of both Beth Israel Deaconess Medical Center and the Massachusetts Institute of Technology (Cambridge, MA, United States). Access to the MIMIC databases is granted to individuals who have completed the Collaborative Institutional Training Initiative (CITI) program. One author (Yuxin Duan) completed the required course and were granted access (certification number: 68219045). The study was reported in accordance with the REporting of studies Conducted using Observational Routinely Collected Health Data (RECORD) statement.

Patients diagnosed with liver cirrhosis were identified based on the International Classification of Diseases, 9th and 10th revisions (ICD-9/10). The diagnosis of gastrointestinal bleeding (GIB) was based on the following ICD codes: ICD-9 codes 4560, 45620, 53021, 5307, 53082, 53100, 53140, 53240, 53783, 53784, 56202, 56212, 56213, 5693, 56985, 5780, 5781, 5789, and ICD-10 codes I8501, I8511, K250, K252, K254, K256, K280, K284, K286, K922, K921. Exclusion criteria were as follows: (1) age < 18 years at the first ICU admission; (2) multiple ICU admissions, with data from only the first admission retained for analysis; (3) GIB before ICU admission; (4) presence of malignancy; and (4) ICU length of stay < 24 h. Ultimately, 3,160 patients were included in the final analysis, with an additional 523 patients from the EICU database used for external validation.

The software PostgreSQL (version 16.9) and Navicat Premium (version 16) were used to extract information with a running Structured Query Language (SQL). The extraction of potential variables could be divided into four main groups: (1) demographics, such as age, gender, weight. (2) Comorbidities, including hypertension (HTN), chronic obstructive pulmonary disease (COPD) acute kidney injury (AKI), sepsis, chronic kidney disease (CKD), ischemic heart disease (IHD). (3) Laboratory indicators, including red blood cells (RBC), white blood cells (WBC), hemoglobin (HGB), platelet (PLT), red cell distribution width (RDW), serum potassium, serum sodium, serum creatinine (Cre), blood urea nitrogen (BUN), alanine aminotransferase (Alt), Aspartate aminotransferase (Ast), total bilirubin (TBIL), international normalized ratio (INR), prothrombin time (pt). (4) Severity of illness scores at admission, including the Acute Physiology Score III (APSIII), the simplified Acute Physiology Score II (SAPS-II), Oxford Acute Severity of Illness Score (OASIS), the Sepsis-related Organ Failure Assessment score (SOFA), the Glasgow Coma Scale (GCS), and Systemic Inflammatory Response Syndrome (SIRS), Child-Turcotte-Pugh score (CTP), Model for End-Stage Liver Disease (MELD, MELD = 3.78 × ln(TBIL) + 11.2 × ln(INR) + 9.57 × ln(Cre) + 6.43), and Model for End-Stage Liver Disease– Sodium (MELD-Na, MELD-Na = MELD + 1.32 × (137−Na) −[0.033 × MELD × (137−Na)]) scores were calculated for each patient based on their individual laboratory and clinical parameters. (5) Medication use following ICU admission, including antibiotics, glucocorticoids, diuretics, anticoagulants, and antiplatelet agents. All predictor variables, including laboratory values, disease severity scores, and medication exposures, were extracted from data generated within the first 24 h after ICU admission.

To avoid potential bias, variables with more than 20% missing data were excluded from the analysis. For variables with less than 20% missingness, multiple imputation was performed using the predictive mean matching (PMM) method implemented via the “mice” package in R (Supplementary Figure 1 and Supplementary Table 1) (13, 14).

Model construction and validation

In this study, feature selection from the training dataset was performed using the Boruta algorithm, a robust wrapper method built upon random forest (RF) classifiers. This technique evaluates the relevance of each variable by comparing its importance score (z-score) against that of artificially created “shadow” features (15). These shadow features are generated by duplicating the original variables and randomly permuting their values. A variable is retained as important if its z-score consistently exceeds the highest z-score among the shadow features across multiple iterations. Features identified as important through this process were subsequently used for model development. Features selected by Boruta were further assessed for multicollinearity using correlation analysis and VIF. Variables with strong correlations (r > 0.8) or high VIF values (> 10) were reviewed and adjusted to ensure model robustness and interpretability (16).

Key variables identified by the Boruta algorithm were incorporated into six distinct ML algorithms for model development, including logistic regression (LR), multilayer perceptron (MLP), support vector machine (SVM), RF, extreme gradient boosting (XGBoost), and gradient boosting machine (GBM) (17). To ensure optimal performance across all ML models, hyperparameter optimization was performed via grid search in combination with 10-fold cross-validation. A systematic evaluation of critical parameters—such as the number of estimators, the maximum depth of trees, and the minimum number of samples required at a leaf node—was conducted during the tuning process. To address class imbalance and prevent data leakage, the Synthetic Minority Over-sampling Technique combined with Edited Nearest Neighbors (SMOTEENN) was implemented within a pipeline structure, ensuring that resampling was applied only to the training folds during cross-validation (18). The procedure was iteratively performed across all cross-validation folds to determine the hyperparameter set that achieved the optimal AUC.

Model performance was primarily evaluated based on the ROC curve, with the model exhibiting the highest AUC selected for further analysis. Discriminative ability was additionally assessed using sensitivity, specificity, accuracy, and the F1-score. Model calibration was evaluated using calibration curves to compare predicted probabilities with observed outcomes. To assess potential clinical applicability, DCA was subsequently performed. The top-performing model was then subjected to interpretability analysis. After being trained on the training cohort, the model parameters were fixed and its performance was subsequently validated on both the testing and external validation cohorts.

To enhance interpretability of the top-performing model, SHAP were employed. Rooted in cooperative game theory, SHAP assigns each input feature a contribution value—known as the Shapley value—by fairly attributing the model’s output to individual predictors. This method not only quantifies feature importance, but also visualizes the direction and magnitude of each variable’s influence on the prediction, thereby offering comprehensive insight into the model’s decision logic. In this study, SHAP analysis played a key role in identifying potential risk factors for GIB in patients with cirrhosis and in validating the robustness and clinical relevance of these predictors across the testing and external validation cohorts.

Continuous variables were summarized as medians with interquartile ranges (IQR), and categorical variables were presented as frequencies and percentages. Differences between groups were assessed using chi-square (χ2) tests or Fisher’s exact tests for categorical variables, and Wilcoxon rank-sum tests for continuous variables. Logistic regression analyses and subgroup analyses were conducted to explore the association between anticoagulant use and the risk of GIB among patients with cirrhosis. All statistical analyses were performed using R software (version 4.3.2; R Foundation for Statistical Computing) and Python (version 3.12.7). Statistical significance was set at a two-tailed p-value of < 0.05.

Results

Participant inclusion and baseline characteristics

A total of 4,115 patients with cirrhosis aged over 18 years admitted to the ICU were initially identified from the MIMIC-IV database. Among these, 337 patients were excluded due to malignant tumors, and 618 were excluded because of a short ICU stay (< 24 h). Ultimately, 3,160 patients were included in the final analysis (Figure 1). Of these patients, 2,061 (65.2%) were male. During their ICU stay, 555 patients (27%) experienced GIB, while 1,506 (78%) did not. Significant differences were observed between the GIB and non-GIB groups in terms of age, vital signs (e.g., Nbpd, HR), and laboratory parameters (e.g., RDW, TBIL). Additionally, a higher proportion of patients in the GIB group met the Sepsis-3 criteria compared to the non-GIB group (71.6% vs. 28.4%). However, there was no significant difference in gender distribution between the two groups. Additional patient characteristics are detailed in Table 1. Baseline characteristics of the training and test cohorts are detailed in Supplementary Tables 2, 3, respectively.

FIGURE 1
Flowchart illustrating a study process with three sections. The “Data Screen” identifies 3,160 ICU cirrhosis patients, dividing them into training (2,528) and test sets (632), filtering 11 features. “Machine Learning Algorithms” include RF, SVM, LGBM, LR, XGBoost, and MLP, highlighting variable importance and model performance. “Visualization” involves SHAP explanations and subgroup analysis, utilizing ROC, calibration, and decision curves with FI scores.

Figure 1. The overall flowchart of the study.

TABLE 1
www.frontiersin.org

Table 1. Baseline characteristics of patients with cirrhosis in ICU.

Boruta-based identification of risk factors for GIB during ICU stay in cirrhotic patients

To determine the most informative predictors of GIB after ICU admission in patients with cirrhosis, the Boruta algorithm was employed. The Z-score ranking of features, presented in Figure 2A, facilitated the exclusion of irrelevant variables and improved downstream model performance. A total of 12 variables—anticoagulant use, HGB, PLT, RDW, RBC, Sapsii, Sofa, TBIL, BUN, MELD, MELD-Na, and CTP—were identified as having high predictive value and were subsequently incorporated into the model as primary features.

FIGURE 2
Box plot and heatmap visualization. The top box plot shows variable importance from Boruta feature filtering, with variables on the x-axis and importance on the y-axis. The heatmap below displays a correlation matrix of continuous variables, with a color gradient from blue to red indicating correlation strength from negative to positive.

Figure 2. Feature selection using Boruta algorithm (A) and the correlation heatmap (B) for predicting gastrointestinal bleeding in cirrhosis patients admitted to the ICU. The horizontal axis represents the name of each variable, while the vertical axis represents the Z value of each variable. The box plot illustrates the distribution of Z values during model calculation. Peach pink boxes indicate important variables, yellow boxes indicate unimportant variables, and pink boxes indicate potentially important variables.

Among the 12 variables selected by the Boruta algorithm, a correlation heatmap was first constructed to explore potential collinearity among continuous variables as shown in Figure 2B. The results indicated a strong correlation between MELD and MELD-Na, suggesting a potential issue of multicollinearity. To further assess this, the VIF was calculated for each variable. Both MELD and MELD-Na demonstrated VIF values exceeding 10, confirming the presence of severe multicollinearity. Based on clinical relevance and their respective associations with the outcome variable, the MELD variable was excluded. After exclusion, VIFs were recalculated, and all remaining variables exhibited VIF values below 10, indicating that multicollinearity had been effectively mitigated. The refined variable set was therefore considered appropriate for subsequent modeling analysis.

RF demonstrated the highest discriminative ability among evaluated ML algorithms for predicting in-ICU GIB in cirrhosis patients

In this study, six ML algorithms were implemented to predict GIB occurrence among ICU-admitted patients with cirrhosis. Model performance was evaluated using ROC curves, calibration curves, and DCA, as presented in Figure 3. Across the training, testing, and validation cohorts, the RF model exhibited superior predictive performance and stability. Specifically, the RF model demonstrated strong discriminative ability in the training cohort, achieving an area under the ROC curve (AUROC) of 0.857 (95% CI, 0.839–0.873), with an accuracy of 70.12%, sensitivity of 88.22%, specificity of 63.47%, precision of 47%, and an F1-score of 61.32%. In the test cohort, the RF model maintained relatively robust performance, showing an AUROC of 0.723 (95% CI, 0.689–0.755), accuracy of 59.07%, sensitivity of 76.47%, specificity of 52.67%, precision of 37.28%, and an F1-score of 50.13%, indicating good generalizability.

FIGURE 3
Nine-panel image displaying model performance through ROC curves (A, B, C), calibration curves (D, E, F), and decision curve analyses (G, H, I) for training, test, and external sets. Each graph compares multiple machine learning models to evaluate their predictive accuracy and decision-making benefits, with each colored line representing a different model. Labels and legends distinguish models and metrics.

Figure 3. The performance and comparison of six different predictive models. (A). ROC curves for the training set. (B) ROC curves for the test set. (C) ROC curves for the validation set. (D) Calibration curve for the training set. (E) Calibration curve for the test set. (F) Calibration curve for the validation set. (G) Decision curve analysis for the training set. (H) Decision curve analysis for the test set. (I) Decision curve analysis for the validation set.

Compared to other ML models, RF exhibited the highest AUROC in the training cohort and the test cohort (Figures 3A,B). Although GBM displayed the highest AUROC in the external cohort (Figure 3C), GBM was excluded from further consideration due to concerns about potential overfitting and diminished predictive capability in new datasets. Other models, including LR, XGBoost, and MLP, also showed strong performance, yet RF was selected as the optimal model due to its consistent robustness across all datasets (Table 2 and Supplementary Table 4).

TABLE 2
www.frontiersin.org

Table 2. Comprehensive performance metrics of multiple machine learning models for predicting GIB in cirrhosis patients admitted to the ICU evaluated across training and test datasets.

SHAP analysis quantifies feature contributions to In-ICU GIB risk in patients with cirrhosis

The SHAP method was applied to interpret the prediction results derived from the best-performing RF model. This analysis identified and ranked the 11 most influential features affecting the prediction of GIB risk among ICU-admitted cirrhosis patients, as shown by their SHAP values (Figure 4A). The X-axis (SHAP value) indicates that a higher SHAP value suggests a greater positive impact of the feature on the prediction outcome (i.e., increasing the likelihood of the predicted event), while a lower value signifies that the feature reduces the likelihood of the event. The color gradient (feature value) from red to blue represents the magnitude of the feature value, with red denoting a high feature value and blue indicating a low feature value.

FIGURE 4
Two charts detail SHAP values for feature importance in a model. Chart A, a horizontal bar graph, ranks features by average impact, with “Anticoagulants_used” as the most influential. Chart B, a dot plot, illustrates the impact distribution of each feature, with color gradients indicating feature value, ranging from blue (low) to red (high).

Figure 4. (A) Bar plot showing the ranked importance of features in the RF model, based on their average absolute SHAP values. (B) Summary plot illustrating the contribution of each feature to the model output. The x-axis represents SHAP values, with each dot corresponding to an individual instance. Red dots indicate higher feature values, while blue dots denote lower ones.

Anticoagulant use was identified as the most influential variable. Higher SHAP values (corresponding to anticoagulant administration) were associated with lower predicted GIB risk, consistent with subsequent regression analysis showing a protective association (OR 0.29, 95% CI 0.24–0.34). Other crucial predictors included RDW, RBC, and PLT. Notably, TBIL and BUN also showed substantial contributions to model predictions. Additional influential variables encompassed higher scores of SAPSII, MELD-Na, SOFA, and CTP. Collectively, these features illustrated their complex and multidimensional relationships within the predictive framework (Figure 4B). For interpretability, individual SHAP value plots (Supplementary Figure 2) were constructed to examine how specific variables contributed to GIB.

These features offered valuable insights into the underlying drivers of GIB in patients with cirrhosis, contributing significantly to both risk prediction and the interpretation of potential pathophysiological mechanisms. The SHAP analysis highlighted anticoagulant use as the strongest predictor, with its administration associated with reduced GIB risk. This paradoxical protective effect may reflect prevention of portal vein thrombosis, maintenance of mesenteric perfusion, or cautious prescribing practices in which anticoagulants are initiated only after careful bleeding risk assessment.

Kaplan-Meier analysis shows significant impact of GIB on short-term survival in patients with cirrhosis

A Kaplan-Meier survival analysis was conducted to evaluate the impact of GIB on short-term survival in patients with cirrhosis. Supplementary Figure 3 presents the survival curves for patients with and without GIB at 15 and 30 days. The results showed that overall survival was lower in the GIB group than in the non-GIB group, and these differences were statistically significant (p = 0.00062 for 15-day survival; p < 0.0001 for 30-day survival). These findings suggest that the occurrence of GIB significantly reduced short-term survival in patients with cirrhosis.

Anticoagulant use identified as a significant predictor of In-ICU GIB risk in patients with cirrhosis

Multivariable logistic regression was performed to further evaluate the association between Anticoagulant use and the risk of in-ICU GIB among patients with cirrhosis. The results, summarized in Table 3, demonstrated a significant relationship between anticoagulant use and GIB occurrence. In the crude, unadjusted analysis, anticoagulants use was significantly associated with decreased odds of GIB (OR 0.29, 95% CI 0.24–0.34, P < 0.001). This significant association persisted after sequential adjustments: Model 1 (adjusted for age, gender, and weight), Model 2 (further adjusted for HTN, diabetes, IHD, COPD, sepsis3, and ascites), and Model 3 (additionally adjusted for all laboratory parameters). Across these adjusted models, the OR values remained consistently significant (P < 0.001), reinforcing anticoagulant use as a critical predictor of GIB during ICU admission among cirrhotic patients.

TABLE 3
www.frontiersin.org

Table 3. Association between anticoagulant therapy and risk of gastrointestinal bleeding in patients with cirrhosis in ICU.

A Kaplan-Meier analysis was also performed to evaluate the effect of anticoagulant therapy in all patients with cirrhosis. As shown in Supplementary Figure 4, there was no significant difference in mortality at 15 and 30 days (p = 0.12 and p = 0.99, respectively). However, among cirrhotic patients with gastrointestinal bleeding, the results differed markedly. In this subgroup, those who received anticoagulant therapy had a lower short-term risk of death compared with those who did not, with statistical significance at both 15 and 30 days (p = 0.0062 and p < 0.001, as shown in Supplementary Figure 5).

Moreover, subgroup analyses and interaction tests were conducted using multivariable logistic regression to explore potential modifying effects of clinical and demographic characteristics on the anticoagulant use–GIB association (Figure 5A). Stratified analyses by age, gender, ascites, HTN, CKD, IHD, and other subgroups consistently showed robust associations, indicating that the relationship between anticoagulant use and GIB remained stable across all evaluated subgroups, even after adjustment for covariates (Figure 5B). These findings underscore the generalizable role of anticoagulant use as a significant predictor of GIB risk among cirrhotic patients admitted to the ICU.

FIGURE 5
Table with forest plots comparing variables like Age, Gender, and medical conditions across two groups: those using anticoagulants and those not. It shows odds ratios, confidence intervals, and p-values, highlighting statistical significance and interactions.

Figure 5. Subgroup analysis showing the association between anticoagulant use and gastrointestinal bleeding. (A) Subgroup analysis of the anticoagulant use–GIB association before covariate adjustment. (B) Subgroup analysis of the anticoagulant use–GIB association after covariate adjustment.

Discussion

This study comprehensively investigates risk factors contributing to GIB among ICU-admitted patients with cirrhosis. Leveraging the Boruta algorithm, key predictive features were identified and evaluated across multiple ML models, ultimately resulting in the development of a robust RF-based predictive model. These findings deepen the understanding of GIB pathophysiology in cirrhotic patients and provide clinicians with a practical tool for early risk stratification to reduce complications during critical care.

Compared to previous studies, this investigation offers several distinct contributions. Notably, patients who experienced GIB demonstrated significantly lower levels of RBC, hemoglobin, and multiple liver function markers compared to those without bleeding events, which is consistent with findings reported in earlier studies (19, 20). For example, Abraldes et al. (21) also observed that even small varices in patients with decompensated cirrhosis carry a measurable risk of hemorrhage, underscoring the clinical relevance of early hematologic and hepatic dysfunction in predicting bleeding episodes. Furthermore, liver function scores including MELD, MELD-Na, and CTP were also significantly associated with the occurrence of GBI, reinforcing prior evidence that impaired hepatic reserve plays a key role in bleeding risk among cirrhotic patients (9). This study reinforces the significance of identified risk factors through multivariable analysis and further improves predictive performance by employing ML techniques. The SOFA score has been widely used and has played a significant role in prognostic assessment of critically ill cirrhotic patients, serving as an established tool for evaluating organ dysfunction and predicting clinical outcomes in intensive care settings (22). While the SOFA score yielded AUCs of 0.550 in the training set and 0.579 in the test set, our RF model achieved substantially higher AUCs of 0.857 (training) and 0.723 (test), indicating markedly improved predictive accuracy. Unlike previous research that primarily focused on upper gastrointestinal bleeding alone (11), the present analysis encompasses a broader range of GIB cases, involves a relatively larger patient cohort, and integrates external validation to assess the stability and generalizability of predictive models. Additionally, utilizing the Boruta algorithm for feature selection combined with the implementation of the RF model contributes to enhanced robustness and achieves superior predictive accuracy, as demonstrated by an AUC of 0.723 in the text set. These methodological advancements highlight the potential of ML-based approaches for precise risk stratification, particularly in the context of complex, high-dimensional clinical datasets.

Moreover, the association between anticoagulant therapy and GIB remained statistically significant in multivariable logistic regression analyses, even after controlling for potential confounders. Anticoagulant use was associated with lower GIB risk—a finding that contrasts with conventional expectations but aligns with emerging evidence on rebalanced hemostasis in cirrhosis (23). This unexpected protective association may be partly attributable to cautious prescribing practices in ICU settings, where anticoagulants are typically administered only after rigorous evaluation, explicitly including bleeding risk assessment. Although patients with liver cirrhosis have historically been characterized by an increased propensity toward bleeding, recent evidence has introduced the concept of “rebalanced hemostasis.” Under these conditions, marked reductions occur in both procoagulant and anticoagulant factors, including substantial decreases in endogenous anticoagulants such as proteins C and S, as well as antithrombin III, potentially tipping the balance toward a prothrombotic state (24). Consequently, anticoagulation could confer protective effects by preventing mesenteric or portal vein thrombosis, mitigating local ischemia, and reducing secondary bleeding episodes. Moreover, anticoagulants such as low-molecular-weight heparin have demonstrated efficacy in preventing portal vein thrombosis (PVT), a crucial factor contributing to worsening portal hypertension and a known exacerbator of gastroesophageal variceal hemorrhage. By preventing or controlling PVT, anticoagulation therapy may indirectly diminish the likelihood of variceal rupture, thereby decreasing overall GIB incidence (25). Additionally, intestinal hypoperfusion frequently occurs in critically ill patients, predisposing them to mucosal ischemia. Here, anticoagulants might exert beneficial effects by inhibiting microthrombus formation, enhancing microcirculatory perfusion, and ultimately reducing the occurrence of stress-induced mucosal injury and related gastrointestinal bleeding (26).

This study presents a novel application of machine learning algorithms to predict GIB in patients with cirrhosis by integrating comprehensive clinical and laboratory data. The use of the MIMIC-IV database, alongside external validation with the EICU dataset, strengthens the robustness and generalizability of the findings across heterogeneous patient populations. Nevertheless, several limitations of this study should be acknowledged. First, the analysis was conducted using the MIMIC-IV database, which is a large, publicly available, single-center critical care dataset. While this dataset provides valuable insights, it is important to note that our study is retrospective in design, which may introduce inherent biases related to documentation and patient selection. Although we performed external validation using the EICU database to strengthen the generalizability of our model, the retrospective nature of both datasets still poses potential limitations in terms of temporal bias and the inability to capture real-time clinical decisions. Future prospective studies are needed to validate our findings in a more dynamic, real-world clinical setting. Second, the absence of granular information regarding surgical or interventional procedures may have introduced unmeasured confounding, as such interventions may impact both bleeding risk and clinical trajectories. Third, GIB events were identified using ICD diagnostic codes without corroboration from endoscopy reports, transfusion records, or hemoglobin trends. While this approach facilitates reproducibility and enables validation across large databases, it may introduce misclassification. Future prospective studies incorporating multi-modal event validation would enhance outcome accuracy. Fourth, due to the retrospective nature of our data and challenges in accurately determining GIB onset timing from electronic health records, we could not reliably exclude patients whose bleeding may have started within the first 24 h after admission. This limitation may introduce minimal time-dependent confounding, as early medication exposures could be influenced by concurrent bleeding in some patients. However, this reflects practical constraints of administrative data and the clinical reality that early ICU risk stratification often occurs when bleeding risk is already developing. Future prospective studies with real-time bleeding monitoring and standardized event adjudication could use stricter landmark designs to reduce temporal bias. At last, while the study specifically addressed the incidence of GIB among ICU patients with liver cirrhosis, it did not evaluate downstream outcomes. Future research should aim to elucidate the long-term prognostic implications of GIB in this population, including mortality, ICU and hospital length of stay, and the risk of recurrent bleeding.

Conclusion

The RF model achieved moderate-to-good discrimination for predicting in-ICU GIB among patients with cirrhosis, with anticoagulant use, hemoglobin, and platelet count identified as key predictors. Prospective validation is needed to confirm the model’s clinical utility in guiding preventive interventions and to further elucidate the protective association observed with anticoagulant therapy.

Data availability statement

The raw data supporting the conclusions of this article will be made available by the authors, without undue reservation.

Ethics statement

Ethical approval was not required for the study involving humans in accordance with the local legislation and institutional requirements. Written informed consent to participate in this study was not required from the participants or the participants’ legal guardians/next of kin in accordance with the national legislation and the institutional requirements.

Author contributions

YD: Writing – original draft. WS: Writing – original draft. ZC: Data curation, Writing – review & editing. YX: Writing – review & editing. JL: Data curation, Writing – review & editing. JF: Data curation Formal analysis, Writing – review & editing.

Funding

The author(s) declare that no financial support was received for the research and/or publication of this article.

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Generative AI statement

The authors declare that no Generative AI was used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Supplementary material

The Supplementary Material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/fmed.2025.1701973/full#supplementary-material

Abbreviations

GIB, Gastrointestinal bleeding; ML, Machine learning; VIF, Variance inflation factor; RF, Random forest; AUC-ROC, Area under the receiver operating characteristic curve; DCA, Decision curve analysis Shap Shapley additive explanations; ICD, International Classification of Diseases; PMM, Predictive mean matching; LR, Logistic regression; MLP, Multilayer perceptron; SVM, Support vector machine; XGBoost, Extreme gradient boosting; GBM, Gradient boosting machine; PVT, Portal vein thrombosis.

References

1. Huang D, Terrault N, Tacke F, Gluud L, Arrese M, Bugianesi E, et al. Global epidemiology of cirrhosis - aetiology, trends and predictions. Nat Rev Gastroenterol Hepatol. (2023) 20:388–98. doi: 10.1038/s41575-023-00759-2

PubMed Abstract | Crossref Full Text | Google Scholar

2. Allen A, Kim W, Moriarty J, Shah N, Larson J, Kamath P. Time trends in the health care burden and mortality of acute on chronic liver failure in the United States. Hepatology. (2016) 64:2165–72. doi: 10.1002/hep.28812

PubMed Abstract | Crossref Full Text | Google Scholar

3. Olson J, Wendon J, Kramer D, Arroyo V, Jalan R, Garcia-Tsao G, et al. Intensive care of the patient with cirrhosis. Hepatology. (2011) 54:1864–72. doi: 10.1002/hep.24622

PubMed Abstract | Crossref Full Text | Google Scholar

4. Malinchoc M, Kamath P, Gordon F, Peine C, Rank J, ter Borg PC. A model to predict poor survival in patients undergoing transjugular intrahepatic portosystemic shunts. Hepatology. (2000) 31:864–71. doi: 10.1053/he.2000.5852

PubMed Abstract | Crossref Full Text | Google Scholar

5. Biggins S, Kim W, Terrault N, Saab S, Balan V, Schiano T, et al. Evidence-based incorporation of serum sodium concentration into MELD. Gastroenterology. (2006) 130:1652–60. doi: 10.1053/j.gastro.2006.02.010

PubMed Abstract | Crossref Full Text | Google Scholar

6. Ripoll C, Bañares R, Rincón D, Catalina M, Lo Iacono O, Salcedo M, et al. Influence of hepatic venous pressure gradient on the prediction of survival of patients with cirrhosis in the MELD Era. Hepatology. (2005) 42:793–801. doi: 10.1002/hep.20871

PubMed Abstract | Crossref Full Text | Google Scholar

7. Augustin S, Muntaner L, Altamirano J, González A, Saperas E, Dot J, et al. Predicting early mortality after acute variceal hemorrhage based on classification and regression tree analysis. Clin Gastroenterol Hepatol. (2009) 7:1347–54. doi: 10.1016/j.cgh.2009.08.011

PubMed Abstract | Crossref Full Text | Google Scholar

8. Tapper EB, Parikh ND. Diagnosis and management of cirrhosis and its complications: a review. JAMA. (2023) 329:1589–602. doi: 10.1001/jama.2023.5997

PubMed Abstract | Crossref Full Text | Google Scholar

9. Zhu Z, Jiang H. Risk stratification based on acute-on-chronic liver failure in cirrhotic patients hospitalized for acute variceal bleeding. BMC Gastroenterol. (2023) 23:148. doi: 10.1186/s12876-023-02768-6

PubMed Abstract | Crossref Full Text | Google Scholar

10. Peng J, Jin H, Zhang N, Zheng S, Yu C, Yu J, et al. Development and evaluation of a predictive model of upper gastrointestinal bleeding in liver cirrhosis. BMC Gastroenterol. (2025) 25:142. doi: 10.1186/s12876-025-03677-6

PubMed Abstract | Crossref Full Text | Google Scholar

11. Tsai S, Lin C, Chu C, Lo H, Ng C, Hsu C, et al. Machine learning models for predicting mortality in patients with cirrhosis and acute upper gastrointestinal bleeding at an emergency department: a retrospective cohort study. Diagnostics. (2024) 14:1919. doi: 10.3390/diagnostics14171919

PubMed Abstract | Crossref Full Text | Google Scholar

12. Johnson A, Bulgarelli L, Shen L, Gayles A, Shammout A, Horng S, et al. MIMIC-IV, a freely accessible electronic health record dataset. Sci Data. (2023) 10:1. doi: 10.1038/s41597-022-01899-x

PubMed Abstract | Crossref Full Text | Google Scholar

13. Blazek K, van Zwieten A, Saglimbene V, Teixeira-Pinto A. A practical guide to multiple imputation of missing data in nephrology. Kidney Int. (2021) 99:68–74. doi: 10.1016/j.kint.2020.07.035

PubMed Abstract | Crossref Full Text | Google Scholar

14. Austin PC, White IR, Lee DS, Van Buuren S. Missing data in clinical research: a tutorial on multiple imputation. Can J Cardiol. (2021) 37:1322–31. doi: 10.1016/j.cjca.2020.11.010

PubMed Abstract | Crossref Full Text | Google Scholar

15. Kou Y, Ye S, Tian Y, Yang K, Qin L, Huang Z, et al. Risk factors for gastrointestinal bleeding in patients with acute myocardial infarction: multicenter retrospective cohort study. J Med Internet Res. (2025) 27:e67346. doi: 10.2196/67346

PubMed Abstract | Crossref Full Text | Google Scholar

16. O’brien RM. A Caution regarding rules of thumb for variance inflation factors. Qual Quant. (2007) 41:673–90. doi: 10.1007/s11135-006-9018-6

Crossref Full Text | Google Scholar

17. Deo R. Machine learning in medicine. Circulation. (2015) 132:1920–30. doi: 10.1161/CIRCULATIONAHA.115.001593

PubMed Abstract | Crossref Full Text | Google Scholar

18. Chawla NV, Bowyer KW, Hall LO, Kegelmeyer WP. SMOTE synthetic minority over-sampling technique. Jair. (2002) 16:321–57. doi: 10.1613/JAIR.953

Crossref Full Text | Google Scholar

19. Shi W, Fan X, Yang J, Ni L, Su S, Yu M, et al. In-hospital gastrointestinal bleeding in patients with acute myocardial infarction: incidence, outcomes and risk factors analysis from China acute myocardial infarction registry. BMJ Open. (2021) 11:e044117. doi: 10.1136/bmjopen-2020-044117

PubMed Abstract | Crossref Full Text | Google Scholar

20. Khan R, Lopes R, Neely M, Stevens S, Harrington R, Diaz R, et al. Characterising and predicting bleeding in high-risk patients with an acute coronary syndrome. Heart. (2015) 101:1475–84. doi: 10.1136/heartjnl-2014-307346

PubMed Abstract | Crossref Full Text | Google Scholar

21. Abraldes J, Caraceni P, Ghabril M, Garcia-Tsao G. Update in the treatment of the complications of cirrhosis. Clin Gastroenterol Hepatol. (2023) 21:2100–9. doi: 10.1016/j.cgh.2023.03.019

PubMed Abstract | Crossref Full Text | Google Scholar

22. Ndomba N, Soldera J. Management of sepsis in a cirrhotic patient admitted to the intensive care unit: a systematic literature review. World J Hepatol. (2023) 15:850–66. doi: 10.4254/wjh.v15.i6.850

PubMed Abstract | Crossref Full Text | Google Scholar

23. Holster I, Valkhoff V, Kuipers E, Tjwa E. New oral anticoagulants increase risk for gastrointestinal bleeding: a systematic review and meta-analysis. Gastroenterology. (2013) 145:105–12.e15. doi: 10.1053/j.gastro.2013.02.041

PubMed Abstract | Crossref Full Text | Google Scholar

24. Armando T, Mannuccio MP. The coagulopathy of chronic liver disease. N Engl J Med. (2011) 365:147–56. doi: 10.1056/NEJMra1011170

PubMed Abstract | Crossref Full Text | Google Scholar

25. Villa E, Cammà C, Marietta M, Luongo M, Critelli R, Colopi S, et al. Enoxaparin prevents portal vein thrombosis and liver decompensation in patients with advanced cirrhosis. Gastroenterology. (2012) 143:1253–60.e4. doi: 10.1053/j.gastro.2012.07.018

PubMed Abstract | Crossref Full Text | Google Scholar

26. Lisman T, Porte RJ. Rebalanced hemostasis in patients with liver disease: evidence and clinical consequences. Blood. (2010) 116:878–85. doi: 10.1182/blood-2010-02-261891

PubMed Abstract | Crossref Full Text | Google Scholar

Keywords: cirrhosis, gastrointestinal bleeding, machine learning, in-ICU, prediction model

Citation: Duan Y, Sui W, Cai Z, Xia Y, Li J and Fu J (2025) Machine learning–based risk stratification for gastrointestinal bleeding in ICU patients with cirrhosis: evidence from the MIMIC database. Front. Med. 12:1701973. doi: 10.3389/fmed.2025.1701973

Received: 29 September 2025; Revised: 11 November 2025; Accepted: 12 November 2025;
Published: 05 December 2025.

Edited by:

Angel Lanas, University of Zaragoza, Spain

Reviewed by:

Jonathan Soldera, University of Caxias do Sul, Brazil
Jan Kubicek, VSB-Technical University of Ostrava, Czechia
Ali Taha, University Hospital Crosshouse, United Kingdom

Copyright © 2025 Duan, Sui, Cai, Xia, Li and Fu. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Jianhua Fu, ZnVqaWFuaHVhNzVAMTI2LmNvbQ==

These authors have contributed equally to this work

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.