
==== Front
Diagnostics (Basel)
Diagnostics (Basel)
diagnostics
Diagnostics
2075-4418
MDPI

10.3390/diagnostics14171919
diagnostics-14-01919
Article
Machine Learning Models for Predicting Mortality in Patients with Cirrhosis and Acute Upper Gastrointestinal Bleeding at an Emergency Department: A Retrospective Cohort Study
Tsai Shih-Chien Writing – original draft 1†
https://orcid.org/0000-0002-8042-5484
Lin Ching-Heng Formal analysis Data curation 23†
Chu Cheng-C. J. Data curation 2
Lo Hsiang-Yun Resources Project administration 1
https://orcid.org/0000-0003-0363-2938
Ng Chip-Jin Project administration 1
Hsu Chun-Chuan Validation Formal analysis 1*
https://orcid.org/0000-0002-3039-9644
Chen Shou-Yen Writing – review & editing Supervision 14*
Zhou Zhuhuang Academic Editor
1 Department of Emergency Medicine, Chang Gung Memorial Hospital, Chang Gung University, Linkou, Taoyuan 333, Taiwan; shihchien0908@gmail.com (S.-C.T.); hsiangyunlo@gmail.com (H.-Y.L.); ngowl@ms3.hinet.net (C.-J.N.)
2 Center for Artificial Intelligence in Medicine, Chang Gung Memorial Hospital, Linkou, Taoyuan 333, Taiwan; chingheng113@gmail.com (C.-H.L.); ccjames@cgmh.org.tw (C.-C.J.C.)
3 Bachelor Program in Artificial Intelligence, Chang Gung University, Taoyuan 333, Taiwan
4 Graduate Institute of Management, College of Management, Chang Gung University, Taoyuan 333, Taiwan
* Correspondence: chuanvm3@gmail.com (C.-C.H.); allendream0621@yahoo.com.tw or allendream0621@gmail.com (S.-Y.C.); Tel.: +886-3-3281-200 (ext. 2505) (S.-Y.C.); Fax: +886-3-3287-715 (S.-Y.C.)
† These authors contributed equally to this work.

30 8 2024
9 2024
14 17 191931 7 2024
28 8 2024
29 8 2024
© 2024 by the authors.
2024
https://creativecommons.org/licenses/by/4.0/ Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Background: Cirrhosis is a major global cause of mortality, and upper gastrointestinal (GI) bleeding significantly increases the mortality risk in these patients. Although scoring systems such as the Child–Pugh score and the Model for End-stage Liver Disease evaluate the severity of cirrhosis, none of these systems specifically target the risk of mortality in patients with upper GI bleeding. In this study, we constructed machine learning (ML) models for predicting mortality in patients with cirrhosis and upper GI bleeding, particularly in emergency settings, to achieve early intervention and improve outcomes. Methods: In this retrospective study, we analyzed the electronic health records of adult patients with cirrhosis who presented at an emergency department (ED) with GI bleeding between 2001 and 2019. Data were divided into training and testing sets at a ratio of 90:10. The ability of three ML models—a linear regression model, an XGBoost (XGB) model, and a three-layer neural network model—to predict mortality in the patients was evaluated. Results: A total of 16,025 patients with cirrhosis and 32,826 ED visits for upper GI bleeding were included in the study. The in-hospital and ED mortality rates were 11.2% and 2.2%, respectively. The XGB model exhibited the highest performance in predicting both in-hospital and ED mortality (area under the receiver operating characteristic curve: 0.866 and 0.861, respectively). International normalized ratio, renal function, red blood cell distribution width, age, and white blood cell count were the strongest predictors in all the ML models. The median ED length of stay for the ED mortality group was 17.54 h (7.16–40.01 h). Conclusions: ML models can be used to predict mortality in patients with cirrhosis and upper GI bleeding. Of the three models, the XGB model exhibits the highest performance. Further research is required to determine the actual efficacy of our ML models in clinical settings.

machine learning
cirrhosis
gastrointestinal bleeding
emergency department
mortality
This research received no funding.
==== Body
pmc1. Introduction

Cirrhosis is a major cause of morbidity and mortality worldwide [1]. In Asia, in addition to nonalcoholic fatty liver disease and alcoholic hepatitis, viral hepatitis remains a major concern [2]. Viral hepatitis, which is widespread in Taiwan, is the primary cause of liver disease and mortality in this region [3]. Patients with cirrhosis often develop many complications. Among these complications, upper gastrointestinal (GI) bleeding is generally the cause of intubation, complications, and death. Variceal bleeding accounts for 60%–65% of all bleeding episodes in patients with cirrhosis [4]. In individuals with and without cirrhosis, upper GI bleeding is associated with a mortality rate of 23.5% and 11.2%, respectively [5]. In a previous study, we reported that the rate of mortality in patients with cirrhosis and upper GI bleeding was 16% at our hospital [6]. In a study conducted in the United States, Farooq et al. reported that the mortality rate of upper GI bleeding was 5.42% in patients with variceal bleeding and 3.79% in patients with nonvariceal bleeding [7].

Multiple scoring systems are available for evaluating the severity of cirrhosis or predicting the survival of patients with cirrhosis, such as the Child–Pugh score and Model for End-stage Liver Disease (MELD) [8]. However, no scoring systems have yet been developed to evaluate the risk of mortality due to upper GI bleeding in patients with cirrhosis. Machine learning (ML) is being increasingly used in various fields, particularly in the medical field [9,10]. Compared with traditional analysis, ML enables the analysis of larger amounts of information and more accurately identifies potentially valuable items.

In this study, we developed a ML model that can accurately predict mortality in patients with cirrhosis and upper GI bleeding, particularly in emergency department (ED) settings. This model can be used in clinical settings to help clinicians treat high-risk patients earlier and reduce the likelihood of adverse events.

2. Materials and Methods

2.1. Study Design

In this retrospective study, we analyzed patients’ electronic health records (EHRs) obtained from Chang Gung Memorial Hospital (CGMH), which is currently the largest healthcare institution in Taiwan and consists of seven medical facilities. We focused on patients with a history of cirrhosis who presented at an ED with symptoms of upper GI bleeding. All adult patients (aged older than 20 years) with a history of cirrhosis who presented at the ED of CGMH between 1 January 2001 and 31 December 2019 were included in the study. Upper GI bleeding was identified by two discharge diagnoses identified through International Classification of Diseases, Ninth Revision, Clinical Modification (ICD-9-CM) codes 578, 5780, 5789, 53501, 53541, 53160, 5342, 53140, 53141, 5310, 5317, 53120, 53121, 53551, 5307, 5312, 5316, 53401, 53400, 53421, 53420, 53531, 53441, 53440, 53461, 53460, 53100, and 53101 or International Classification of Diseases, Tenth Revision, Clinical Modification (ICD-10-CM) codes K920, K921, K922, K226, K256, K9421, K250, K252, K254, K286, K284, K282, K280, K274, K279, and I8501. Cirrhosis was identified through ICD-9-CM codes 571, 5712, 5715, and 5716 and ICD-10-CM codes K703, K7030, K7031, K74, K7460, K744, K745, K746, K7469, K743, K717, and P7881. Patients meeting the following criteria were excluded from the study: under 20 years of age; being a patient of trauma, obstetrics, or gynecology; and having no history of cirrhosis. Data on demographics, triage vital signs, blood tests, physical examinations, and treatment, including blood transfusion and medication, were collected. The MELD score was calculated for all patients [11].

2.2. Data Source and Preprocessing

EHR data were obtained from the Chang Gung Research Database, which is the largest multi-institutional EHR database in Taiwan and includes data from all seven CGMH facilities [12]. The study protocol was approved by the Institutional Review Board of CGMH (IRB no. 202200332B0). All patient information used in the study was anonymized and stripped of any identifying details. In terms of physiological measurements (e.g., vital signs), we replaced abnormally high or low values with missing values because they presumably indicated human error rather than actual measurements (e.g., weight > 400 kg). For continuous variables, we defined outliers as values exceeding 1.5 times the interquartile range of the empirical distribution. We replaced these values with missing values for later data imputation. For discrete variables, missing values were categorized as a new class, and categories with fewer than five occurrences were excluded. This ensured that enough samples were available for training, validation, and testing of the models. We used the Chi-squared test for categorical variables and Welch Two Sample t-test for continuous variables.

The proportion of missing data was high (>10%) for seven variables: blood urea nitrogen (BUN), basophil, eosinophil, lymphocyte, monocyte, segment, and blood glucose levels (missing rate ~15%). To solve this problem, we conducted a SenMice imputation, which yielded similar findings to those of the median imputation. Therefore, we adopted the results of median imputation in this study. After partitioning the data into training and testing data sets at a ratio of 90:10, we stored the testing set for evaluation once the final model was complete.

2.3. Prediction Model Construction and Evaluation

The ability of three classic ML models—the linear regression (LR) model, the XGBoost (XGB) model, and a three-layer neural network (NN) model—to predict mortality in patients with cirrhosis and upper GI bleeding was evaluated. To construct these models and select the optimal model through 10-fold cross-validation, we used the mljar-supervised AutoML tool and performed hyperparameter tuning [13]. The area under the receiver operating characteristic curve (AUROC) was selected as the evaluation metric. We used the optimal predictive model to examine the risk factors influencing the prognosis in follow-up groups, through Shapley Additive Explanations (SHAP) values. All statistical analyses were conducted using the R tableone package (version 0.12.0) and Python sklearn package (version 1.2.2).

3. Results

A total of 122,335 patients with GI bleeding were included in this retrospective study. After 89,509 patients had been excluded, 32,826 ED visits for upper GI bleeding were recorded for 16,025 patients with cirrhosis. As shown in Figure 1, the data were divided into a training set (90%) and a testing set (10%). Table 1 presents the characteristics of the in-hospital mortality, ED mortality, and survival groups. The overall rates of in-hospital mortality and ED mortality were 11.2% and 2.2%, respectively.

Compared with the survival group, the in-hospital mortality group exhibited more severe upper GI bleeding (indicated by triage level; 58.1% vs. 38.0%, p < 0.001) and were more likely to have been transported by an ambulance (11.5% vs. 5.4%, p < 0.001). The in-hospital mortality group also had a higher heart rate (99 vs. 96 beats per minute, p < 0.001) and lower systolic blood pressure (SBP; 112 vs. 126 mmHg, p < 0.001) at the ED. In terms of laboratory data, the in-hospital mortality group exhibited a lower hemoglobin level (8.83 vs. 9.27 g/dL, p < 0.001), a higher white blood cell (WBC) count (11.5 × 103/μL vs. 7.71 × 103/μL, p < 0.001), and a higher creatinine level (2.35 vs. 1.62 mg/dL, p < 0.001) compared with the survival group. The in-hospital mortality group had poorer liver function, including a higher international normalized ratio (INR; 1.74 vs. 1.35, p < 0.001), a higher aspartate aminotransferase level (307.6 vs. 92.0 U/L, p < 0.001), a lower albumin level (2.6 vs. 3.1 g/dL, p < 0.001), and a higher bilirubin level (6.5 vs. 2.6 mg/dL, p < 0.001). Compared with the survival group, the in-hospital mortality group received a higher MELD score on average (25 vs. 15, p < 0.001). Similar significant differences were found in the results of comparison between the ED death and ED survival groups.

Table 2 and Table 3 present the performance of the different models in predicting in-hospital mortality and ED mortality, respectively, in patients with cirrhosis and upper GI bleeding. The MELD score was selected as a traditional evaluation tool, and LR, XGB, and NN models were employed as ML models. The XGB model was the ML model with the highest predictive performance and was also found to perform better than the MELD score. As shown in Figure 2, the AUROCs for predicting in-hospital mortality, from high to low, were 0.866 for the XGB model, 0.837 for the NN model, 0.817 for the LR model, and 0.779 for the MELD. Similarly, the AUROCs for predicting ED mortality were 0.861 for the XGB model, 0.815 for the LR model, 0.809 for the NN model, and 0.776 for the MELD. Of the three ML models, the XGB model exhibited the highest accuracy (0.780), sensitivity (0.788), specificity (0.799), positive predictive value (0.309), and negative predictive value (0.967) in predicting in-hospital mortality. It exhibited a similar performance in the prediction of ED mortality.

Figure 3 illustrates the SHAP values for the parameters used in predicting in-hospital mortality and ED mortality. The five parameters with the largest weights for predicting both in-hospital mortality and ED mortality were INR, creatinine level, red blood cell distribution width (RDW), WBC count, and age. The most crucial five parameters for the prediction of in-hospital mortality were albumin level, lymphocyte count, total bilirubin level, sodium level, and platelet count. The most crucial five parameters for the prediction of ED mortality were SBP, prothrombin time, eosinophil count, BUN level, and erythrocyte mean corpuscular volume (MCV). As shown in Figure 4, the median length of ED stay for the ED mortality group was 17.54 h (7.16–40.01 h).

4. Discussion

Upper GI bleeding can be life-threatening. Upper GI bleeding is associated with a 30-day mortality rate of 10%, and esophageal variceal bleeding is associated with a 30-day mortality rate of 50% [14]. Therefore, predicting the risk of mortality in patients with upper GI bleeding is essential in EDs, and ML models can be assistive in these predictions. In this study, we discovered a significant incidence of upper GI bleeding complicating cirrhosis, with an associated high mortality rate of 11.2%. We developed a ML model to predict mortality in patients with cirrhosis who present with upper GI bleeding at an ED, and the model was found to achieve outstanding performance.

Compared with traditional scoring systems, ML models make better predictions because they include a wider range of features and utilize more complex computational models. Previous studies have compared the performance of the Child–Pugh score and MELD score in predicting in-hospital mortality for cirrhotic patients with acute upper GI bleeding, reporting AUCs of 0.81 and 0.79, respectively [15]. We further compared the predictive abilities of traditional cirrhosis scoring tools with those of ML methods. Although scholars have attempted to use artificial neural networks to predict mortality in patients with cirrhosis and upper GI bleeding, these studies have primarily targeted long-term mortality rates, which are not applicable in the prediction of mortality at ED and during short-term hospital stays [16,17]. Hence, developing novel ML models for the early prediction of mortality in high-risk patients is essential for physicians to reduce the likelihood of adverse events by monitoring and treating patients both carefully and aggressively.

In this study, certain characteristics—INR, renal function, RDW, age, and WBC count—were identified by ML models as being the strongest predictors of both ED mortality and in-hospital mortality. As expected, higher INR was found to correlate with mortality in patients with cirrhosis and upper GI bleeding upon ED admission, consistent with previous research [18]. A higher INR indicates more severe bleeding resulting from poorer coagulation, reflecting poorer liver conditions in patients with cirrhosis. Controlling the patient’s coagulopathy is crucial and must be carried out promptly. Decreased renal function is a key predictor associated with reduced renal perfusion resulting from acute blood loss [19,20]. Older age is associated with higher mortality risk; in a previous study, Lecleire et al. discovered that being older than 60 years of age was a factor in predicting mortality in patients with upper GI bleeding, regardless of whether they had cirrhosis [5]. These indicate that the patient’s own health status (such as age and kidney function) is closely related to mortality. A large RDW suggests severe anemia or hemorrhage. Lee et al. reported that an RDW of 14.5% or greater was strongly linked to a high risk of upper GI bleeding [21]. The RDW is increased in patients with cirrhosis and positively correlates with coagulation, renal function, and bilirubin level [22]. A high WBC count was a predictor of short-term mortality in our study, presumably as a result of acute stress to hemorrhage. High WBC count can be observed in patients with GI bleeding, and the count reflects the severity of the bleeding [18,23,24]. When a patient presents with anemia, we should pay attention not only to hemoglobin levels but also to other hemogram indices.

Some other important features were found in our ML models to predict ED mortality. For instance, low SBP at triage suggests severe bleeding with hypovolemia and is a strong prognostic factor in cases of upper GI bleeding [25]. An elevated BUN level, common in patients with upper GI bleeding, is a result of blood protein breakdown and absorption in the upper GI tract; BUN values of 21 mg/dL or greater suggest severe upper GI bleeding [26]. A high MCV correlates with a high MELD score in patients with cirrhosis, and macrocytic anemia is closely linked to the degree of liver damage [27,28]. In patients with cirrhosis, a high MCV suggests poor liver function, which is associated with increased mortality risk.

Certain features were found to be more significant predictors of in-hospital mortality in our ML models. For instance, sodium, bilirubin, and albumin levels, which are typically used in traditional scoring systems such as the Child–Pugh score or MELD-Na score for cirrhosis, reflect cirrhotic status and correlate with mortality and morbidity in patients with cirrhosis. Hyponatremia develops secondary to portal hypertension, which is a consequence of advanced cirrhosis and is associated with high morbidity and mortality risks [29,30]. In patients with cirrhosis and upper GI bleeding, impaired liver function with high bilirubin and low albumin levels is associated with an increased mortality risk [18].

Most of our models exhibited high performance in predicting mortality in patients with cirrhosis and upper GI bleeding, for death either at the ED or in hospital. However, of our ML models, the NN model had relatively low predictive performance, presumably because our data were more suitable for traditional ML models or because our three-layer NN was not sufficiently complex. Compared with this NN model, the XGB model required less computational power and made its predictions more quickly, which would be beneficial for physicians in the ED, helping them prioritize examinations, treatment, and dispositions. Overall, establishing the optimal predictive model would assist healthcare providers in identifying patients at high risk of mortality, enabling them to administer more intensive treatments or initiate interventions earlier. Although our proposed ML model performed highly, further research is required to confirm its suitability for clinical applications.

This study has some limitations. First, we did not subgroup the patients with cirrhosis on the basis of the cirrhosis etiology, and we did not subdivide upper GI bleeding into esophageal, gastric, and duodenal categories. Since these patients arrive at the ED without having undergone an endoscopy, we do not know the source of their bleeding initially. Our goal is to provide mortality risk predictions early in the ED. Second, the times of death in the ED and wards overlapped, presumably because our wards were often at their full capacity, which resulted in a longer than necessary ED stay for some patients. Third, certain data points were missing, necessitating the use of values approximating the median for imputation. Fourth, some parameters that we did not check routinely at ED may affect the results of traditional scoring systems.

5. Conclusions

ML models can be used to predict mortality in patients with cirrhosis who present to an ED with upper GI bleeding, and their performance is higher than that of traditional scoring systems. Of all our ML models, the XGB model exhibits the highest predictive performance. INR, renal function, RDW, age, and WBC count are the strongest predictors in our ML models. The results generally align with our foundational knowledge and logic. We hope to utilize the convenience and speed of ML to predict the prognosis of patients shortly after their arrival in the emergency department. In addition to the overall results predicted by machine learning, we can also discuss expected treatment goals with patients based on factors such as age and chronic conditions (e.g., kidney disease). This approach allows us to determine whether to pursue aggressive treatment or consider the patient’s thoughts on a do-not-resuscitate (DNR) order, thereby enhancing the value of shared decision-making between physicians and patients. Although our ML models are applicable in this field, further research is required to determine their actual efficacy in clinical settings.

Acknowledgments

This study was supported by CGMH. The authors would like to thank their colleagues who offered their expertise and greatly assisted in this study.

Author Contributions

S.-Y.C. and C.-C.H. conceived and designed the study. C.-C.J.C. and C.-H.L. were responsible for data acquisition, analysis, and interpretation. C.-H.L. and C.-C.J.C. conducted the statistical analyses. S.-C.T. and C.-C.H. drafted the manuscript. C.-J.N. and H.-Y.L. were responsible for project administration and supervision. S.-Y.C. revised the manuscript for intellectual content. All authors have read and agreed to the published version of the manuscript.

Institutional Review Board Statement

This study was approved by the Institutional Review Board of CGMH, Taiwan (IRB no. 202200332B0) on 14 March 2022.

Informed Consent Statement

This is a retrospective study conducted from a de-identified database and informed consent of participation is waived by the Institutional Review Board of CGMH, Taiwan (IRB no. 202200332B0).

Data Availability Statement

The data used in this study were obtained from the Chang Gung Research Database. All analyses were conducted in an isolated space. Data regarding the analytical process and original results are available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors had no conflicts of interest.

Abbreviations

GI	Gastrointestinal	
MELD	Model for End-stage Liver Disease	
ML	Machine learning	
ED	Emergency department	
LR	Linear regression	
XGB	XGBoost	
NN	Neural network	
BUN	Blood urea nitrogen	
SBP	Systolic blood pressure	
WBC	White blood cell	
INR	International normalized ratio	
RDW	Red blood cell distribution width	
MCV	Mean corpuscular volume	

Figure 1 Flowchart of study population selection and division of the training and testing sets.

Figure 2 Comparison of the performance (AUROC) of various models in predicting mortality in patients with cirrhosis and upper GI bleeding. LR: logistic regression; XGB: XGBoost; NN: neural network; MELD: Model for End-stage Liver Disease.

Figure 3 Ten most crucial features in the models.

Figure 4 Length of stay of patients with ED death.

diagnostics-14-01919-t001_Table 1 Table 1 Comparison of the ED mortality, in-hospital mortality, and survival groups of patients with cirrhosis presenting with upper GI bleeding at an ED.

Demographics	
	In-Hospital Deaths	Survival		ED Deaths	Survival at ED		
n = 3662	n = 29,164	n = 728	n = 32,098	
Age, years, mean (SD)	62.1 (13.9)	58.8 (13.9)	p < 0.001	59.1 (14.2)	59.9 (13.9)	p = 0.13	
Gender, male, N (%)	2799 (76.43)	21,369 (73.27)	p < 0.001	583 (80.1)	23,585 (73.48)	p < 0.001	
Arrival by ambulance, N (%)	420 (11.5)	1588 (5.4)	p < 0.001	99 (13.6)	1927 (6.6)	p < 0.001	
Triage level 1 or 2, N (%)	2129 (58.1)	11,078 (38.0)	p < 0.001	471 (64.7)	12,727 (39.7)	p < 0.001	
Triage vital signs	
BT, °C, median (IQR)	36.2 (36.0–36.8)	36.5 (36.0–36.9)	p < 0.001	36.2 (35.8–36.8)	36.4 (36.0–36.8)	p < 0.001	
HR, bpm, median (IQR)	99 (84–114)	96 (82–112)	p = 0.006	102 (82–117)	97 (82–112)	p = 0.99	
RR, breaths per minute, median (IQR)	19 (18–20)	20 (18–20)	p < 0.001	20 (18–22)	19 (18–20)	p = 0.04	
SBP, mmHg, median (IQR)	112 (93–135)	126 (107–146)	p < 0.001	103 (82–128)	126 (106–146)	p < 0.001	
DBP, mmHg, Median (IQR)	66 (54–78)	72 (61–84)	p < 0.001	60 (50–75)	72 (61–83)	p < 0.001	
Initial laboratory data	
Hb, g/dL, mean (SD)	8.83, (2.47)	9.27, (2.68)	p < 0.001	8.61, (2.62)	9.24, (2.66)	p < 0.001	
Hct, %, mean (SD)	26.5, (7.02)	28.1, (7.45)	p < 0.001	26.3, (7.48)	28.0, (7.42)	p < 0.001	
WBC, 1000/uL, mean (SD)	11.5, (10.5)	7.71, (4.92)	p < 0.001	12.7, (10.4)	8.03, (5.6)	p < 0.001	
Segment, %, mean, (SD)	77.1, (13.0)	70.9, (12.3)	p < 0.001	74.2, (15.9)	71.5, (12.4)	p < 0.001	
Platelets, 1000/uL, mean (SD)	142.2, (103.4)	121.7, (84.2)	p < 0.001	134.8, (113.2)	123.7, (86.1)	p = 0.02	
PT, seconds, mean (SD)	18.8, (10.0)	14.6, (5.40)	p < 0.001	21.6, (12.2)	14.9, (6.0)	p < 0.001	
INR, mean (SD)	1.74, (1.0)	1.35, (0.52)	p < 0.001	2.0, (1.26)	1.4, (0.6)	p < 0.001	
BUN, mean (SD)	46.9, (36.7)	31.1, (25.5)	p < 0.001	43.6, (35.2)	32.8, (27.3)	p < 0.001	
Creatinine, mg/dL, mean (SD)	2.35, (2.01)	1.62, (1.86)	p < 0.001	2.47, (2.02)	1.68, (1.89)	p < 0.001	
AST, U/L, mean (SD)	307.6, (1341.8)	92.0, (231.7)	p < 0.001	478.9, (2150.9)	113.9, (442.1)	p < 0.001	
ALT, U/L, mean (SD)	94.6, (221.6)	46.2, (72.2)	p < 0.001	106.7, (285.1)	49.8, (89.7)	p < 0.001	
Albumin, g/dL, mean (SD)	2.6, (0.6)	3.1, (0.7)	p < 0.001	2.5, (0.6)	3.0, (0.7)	p < 0.001	
Total bilirubin, mg/dL, mean (SD)	6.5, (8.0)	2.6, (3.3)	p < 0.001	6.1, (7.1)	3.0, (4.3)	p < 0.001	
Ammonia, ug/dL, mean (SD)	199.6, (218.9)	136.8, (104.9)	p < 0.001	286.9, (321.6)	143.2, (120.3)	p < 0.001	
Na, mEq/L, mean (SD)	133.7, (6.84)	136.5, (4.85)	p < 0.001	135.2, (7.47)	136.4, (5.12)	p = 0.002	
K, mEq/L, mean (SD)	4.6, (1.1)	4.1, (0.8)	p < 0.001	4.7, (1.4)	4.2, (0.8)	p < 0.001	
MELD score, median (IQR)	25 (19–30)	15 (10–21)	p < 0.001	25, (19–31)	17 (11–22)	p < 0.001	
ED: emergency department; BT: body temperature; SBP: systolic blood pressure; DBP: diastolic blood pressure; RR: respiratory rate; HR: heart rate; bpm: beats per minute; IQR: interquartile range; SD: standard deviation; Hb: hemoglobin; Hct: hematocrit; WBC: white blood cell; PT: prothrombin time; BUN: blood urea nitrogen; AST: aspartate aminotransferase; ALT: alanine transaminase; INR: international normalized ratio; MELD: Model for End-stage Liver Disease.

diagnostics-14-01919-t002_Table 2 Table 2 Model performance for predicting in-hospital mortality in patients with cirrhosis and GI bleeding.

Model	AUC	Best Threshold	Accuracy	Sensitivity	Specificity	PPV	NPV	
LR	0.817	0.112	0.765 (0.760–0.769)	0.717	0.771	0.281	0.956	
XGB	0.866	0.101	0.780 (0.776–0.785)	0.788	0.779	0.309	0.967	
NN	0.837	0.101	0.753 (0.748–0.756)	0.761	0.752	0.278	0.962	
MELD score	0.779	0.137	0.725 (0.719–0.731)	0.687	0.731	0.282	0.938	
LR: logistic regression; XGB: XGBoost; NN: neural network; PPV: positive predictive value; NPV: negative predictive value; MELD: Model for End-stage Liver Disease.

diagnostics-14-01919-t003_Table 3 Table 3 Model performance for predicting ED mortality in patients with cirrhosis and GI bleeding.

Model	AUC	Best Threshold	Accuracy	Sensitivity	Specificity	PPV	NPV	
LR	0.815	0.021	0.747 (0.743–0.752)	0.722	0.747	0.061	0.992	
XGB	0.861	0.018	0.767 (0.762–0.771)	0.8	0.766	0.072	0.994	
NN	0.809	0.019	0.757 (0.746–0.755)	0.701	0.752	0.06	0.991	
MELD score	0.776	0.022	0.740 (0.734–0.746)	0.667	0.741	0.056	0.99	
LR: logistic regression; XGB: XGBoost; NN: neural network; PPV: positive predictive value; NPV: negative predictive value; MELD: Model for End-stage Liver Disease.

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
==== Refs
References

1. Moon A.M. Singal A.G. Tapper E.B. Contemporary Epidemiology of Chronic Liver Disease and Cirrhosis Clin. Gastroenterol. Hepatol. 2020 18 2650 2666 10.1016/j.cgh.2019.07.060 31401364
2. Alberts C.J. Clifford G.M. Georges D. Negro F. Lesi O.A. Hutin Y.J. de Martel C. Worldwide prevalence of hepatitis B virus and hepatitis C virus among patients with cirrhosis at country, region, and global levels: A systematic review Lancet Gastroenterol. Hepatol. 2022 7 724 735 10.1016/S2468-1253(22)00050-4 35576953
3. Su S.Y. Lee W.C. Mortality trends of liver diseases from 1981 to 2016 and the projection to 2035 in Taiwan: An age-period-cohort analysis Liver Int. 2019 39 770 776 10.1111/liv.14027 30554476
4. Garcia-Tsao G. Sanyal A.J. Grace N.D. Carey W. Practice Guidelines Committee of the American Association for the Study of Liver Diseases Practice Parameters Committee of the American College of Gastroenterology Prevention and management of gastroesophageal varices and variceal hemorrhage in cirrhosis Hepatology 2007 46 922 938 10.1002/hep.21907 17879356
5. Lecleire S. Di Fiore F. Merle V. Herve S. Duhamel C. Rudelli A. Nousbaum J.B. Amouretti M. Dupas J.L. Gouerou H. Acute upper gastrointestinal bleeding in patients with liver cirrhosis and in noncirrhotic patients: Epidemiology and predictive factors of mortality in a prospective multicenter population-based study J. Clin. Gastroenterol. 2005 39 321 327 10.1097/01.mcg.0000155133.50562.c9 15758627
6. Hsu S.C. Chen C.Y. Weng Y.M. Chen S.Y. Lin C.C. Chen J.C. Comparison of 3 scoring systems to predict mortality from unstable upper gastrointestinal bleeding in cirrhotic patients Am. J. Emerg. Med. 2014 32 417 420 10.1016/j.ajem.2014.01.009 24560395
7. Farooq U. Tarar Z.I. Franco D. Kamal F. Abegunde A.T. Comparison of outcomes between variceal and non-variceal gastrointestinal bleeding in patients with cirrhosis: Insights from a Nationwide Inpatient Sample Ann. Gastroenterol. 2022 35 618 626 10.20524/aog.2022.0744 36406963
8. Singal A.K. Kamath P.S. Model for End-stage Liver Disease J. Clin. Exp. Hepatol. 2013 3 50 60 10.1016/j.jceh.2012.11.002 25755471
9. Davenport T. Kalakota R. The potential for artificial intelligence in healthcare Future Healthc. J. 2019 6 94 98 10.7861/futurehosp.6-2-94
10. Rong G. Mendez A. Bou Assi E. Zhao B. Sawan M. Artificial Intelligence in Healthcare: Review and Prediction Case Studies Engineering 2020 6 291 301 10.1016/j.eng.2019.08.015
11. Kamath P.S. Wiesner R.H. Malinchoc M. Kremers W. Therneau T.M. Kosberg C.L. D’Amico G. Dickson E.R. Kim W.R. A model to predict survival in patients with end-stage liver disease Hepatology 2001 33 464 470 10.1053/jhep.2001.22172 11172350
12. Tsai M.S. Lin M.H. Lee C.P. Yang Y.H. Chen W.C. Chang G.H. Tsai Y.T. Chen P.C. Tsai Y.H. Chang Gung Research Database: A multi-institutional database consisting of original medical records Biomed. J. 2017 40 263 269 10.1016/j.bj.2017.08.002 29179881
13. Płońska A.P. Płoński P. Mljar: State-of-the-Art Automated Machine Learning Framework for Tabular Data, Version 0.10.3 Available online: https://github.com/mljar/mljar-supervised (accessed on 28 August 2024)
14. Haas N.L. Medlin R.P. Jr. Cranford J.A. Boyd C. Havey R.A. Losman E.D. Rice M.D. Bassin B.S. An emergency department-based intensive care unit is associated with decreased hospital length of stay for upper gastrointestinal bleeding Am. J. Emerg. Med. 2021 50 173 177 10.1016/j.ajem.2021.07.057 34371325
15. Peng Y. Qi X. Dai J. Li H. Guo X. Child-Pugh versus MELD score for predicting the in-hospital mortality of acute upper gastrointestinal bleeding in liver cirrhosis Int. J. Clin. Exp. Med. 2015 8 751 757 25785053
16. Hou Y. Yu H. Zhang Q. Yang Y. Liu X. Wang X. Jiang Y. Machine learning-based model for predicting the esophagogastric variceal bleeding risk in liver cirrhosis patients Diagn. Pathol. 2023 18 29 10.1186/s13000-023-01293-0 36823660
17. Soldera J. Tomé F. Corso L.L. Rech M.M. Ferrazza A.D. Terres A.Z. Cini B.T. Eberhardt L.Z. Balensiefer J.I.L. Balbinot R.S. Use of a machine learning algorithm to predict rebleeding and mortality for esophageal variceal bleeding in cirrhotic patients United Eur. Gastroenterol. J. 2020 8 159 160 10.1177/2050640620927345
18. Bishay K. Tandon P. Fisher S. Yelle D. Carrigan I. Wooller K. Kelly E. Clinical Factors Associated with Mortality in Cirrhotic Patients Presenting with Upper Gastrointestinal Bleeding J. Can. Assoc. Gastroenterol. 2020 3 127 134 10.1093/jcag/gwy075 32395687
19. Fede G. D’Amico G. Arvaniti V. Tsochatzis E. Germani G. Georgiadis D. Morabito A. Burroughs A.K. Renal failure and cirrhosis: A systematic review of mortality and prognosis J. Hepatol. 2012 56 810 818 10.1016/j.jhep.2011.10.016 22173162
20. Cardenas A. Gines P. Uriz J. Bessa X. Salmeron J.M. Mas A. Ortega R. Calahorra B. De Las Heras D. Bosch J. Renal failure after upper gastrointestinal bleeding in cirrhosis: Incidence, clinical course, predictive factors, and short-term prognosis Hepatology 2001 34 671 676 10.1053/jhep.2001.27830 11584362
21. Lee K.R. Park S.O. Kim S.Y. Hong D.Y. Kim J.W. Baek K.J. Shin D.H. Lee Y.H. Red cell distribution width as a novel marker for predicting high-risk from upper gastro-intestinal bleeding patients PLoS ONE 2017 12 e0187158 10.1371/journal.pone.0187158 29095860
22. Hu Z. Sun Y. Wang Q. Han Z. Huang Y. Liu X. Ding C. Hu C. Qin Q. Deng A. Red blood cell distribution width is a potential prognostic index for liver disease Clin. Chem. Lab. Med. 2013 51 1403 1408 10.1515/cclm-2012-0704 23314558
23. Mank V. Azhar W. Brown K. Leukocytosis StatPearls StatPearls Publishing Treasure Island, FL, USA 2023
24. Chalasani N. Patel K. Clark W.S. Wilcox C.M. The prevalence and significance of leukocytosis in upper gastrointestinal bleeding Am. J. Med. Sci. 1998 315 233 236 10.1097/00000441-199804000-00003 9537636
25. Katschinski B. Logan R. Davies J. Faulkner G. Pearson J. Langman M. Prognostic factors in upper gastrointestinal bleeding Dig. Dis. Sci. 1994 39 706 712 10.1007/BF02087411 7908623
26. Tomizawa M. Shinozaki F. Hasegawa R. Shirai Y. Motoyoshi Y. Sugiyama T. Yamamoto S. Ishige N. Patient characteristics with high or low blood urea nitrogen in upper gastrointestinal bleeding World J. Gastroenterol. 2015 21 7500 7505 10.3748/wjg.v21.i24.7500 26139996
27. Yang J. Yan B. Yang L. Li H. Fan Y. Zhu F. Zheng J. Ma X. Macrocytic anemia is associated with the severity of liver impairment in patients with hepatitis B virus-related decompensated cirrhosis: A retrospective cross-sectional study BMC Gastroenterol. 2018 18 161 10.1186/s12876-018-0893-9 30384828
28. Zhao T.Y. Cong Q.W. Liu F. Yao L.Y. Zhu Y. Nonlinear Relationship Between Macrocytic Anemia and Decompensated Hepatitis B Virus Associated Cirrhosis: A Population-Based Cross-Sectional Study Front. Pharmacol. 2021 12 755625 10.3389/fphar.2021.755625 34616304
29. John S. Thuluvath P.J. Hyponatremia in cirrhosis: Pathophysiology and management World J. Gastroenterol. 2015 21 3197 3205 10.3748/wjg.v21.i11.3197 25805925
30. Bengus A. Babiuc R.D. Hyponatremia—Predictor of adverse prognosis in cirrhosis J. Med. Life 2012 5 176 178 22802886
