A subscription to JoVE is required to view this content. Sign in or start your free trial.

Research Article

Machine Learning Model for Predicting Risk Factor Analysis and a Mortality Prediction Model of Acute Cholangitis Complicated with Sepsis

114 views

⸱

DOI:

10.3791/72165

⸱

September 8th, 2026

 ,  ,  ,  ,  ,  ,  , 

* These authors contributed equally

In This Article

Summary

Here, we describe an interpretable machine-learning workflow for three outcome-specific tasks in acute cholangitis: general-ward sepsis prediction, general-ward in-hospital mortality prediction, and ICU 28-day mortality prediction. The workflow integrates feature selection, model comparison, SHAP interpretation, regression analyses, and nomogram construction.

Abstract

This study examined factors associated with sepsis in acute cholangitis and developed outcome-specific models for sepsis and mortality. We retrospectively analyzed data from 1,999 patients across two centers, including 1,561 admitted to general wards and 438 to the ICU. For each prediction task, the data were divided into training and internal-validation cohorts at a 7:3 ratio. Logistic regression (LR), random forest (RF), support vector machine (SVM), and Extreme Gradient Boosting (XGBoost) models were developed and compared, and Shapley Additive Explanations (SHAP) were used for interpretation. Sepsis occurred in 544 general-ward patients (34.85%) and 299 ICU patients (68.3%). LR achieved the highest internal-validation AUC for general-ward sepsis prediction (0.826; training AUC, 0.893). Sepsis was associated with poorer in-hospital survival in the general-ward cohort and poorer 28-day survival in the ICU cohort. The ICU 28-day mortality nomogram incorporated Acute Physiology Score III (APS III), hemoglobin (Hb), alanine aminotransferase (ALT), lactate (Lac), total bilirubin (TBil), albumin, sepsis status, and kidney injury and yielded an AUC of 0.840. The general-ward in-hospital mortality nomogram incorporated albumin, kidney injury, sepsis status, blood urea nitrogen (BUN), TBil, and aspartate aminotransferase (AST), yielding an AUC of 0.904. The internally validated models showed preliminary discriminatory ability for outcome-specific risk stratification. Prospective multicenter external validation is required before clinical implementation.

Introduction

Acute cholangitis is a potentially life-threatening biliary tract infection caused by biliary obstruction and bacterial proliferation1. First described by Charcot in 1877 as "liver fever," its classic presentation is Charcot triad: fever, right upper-quadrant abdominal pain, and jaundice. Severe disease may manifest as the Reynolds pentad, which adds hypotension and altered mental status2. Common causes include choledocholithiasis, biliary strictures, biliary tumors, and parasitic obstruction; choledocholithiasis accounts for approximately half of cases1. Biliary obstruction causes bile stasis and increased intraductal pressure, which can impair the biliary epithelial barrier, promote bacterial translocation, and trigger inflammation3. Overall mortality ranges from approximately 2.7% to 10% but may reach 50% in severe disease4. Bacteria and endotoxins may enter the circulation in severe acute cholangitis, provoking systemic inflammation and sepsis.

Sepsis is characterized by life-threatening organ dysfunction caused by a dysregulated host response to infection and may progress to multiorgan failure5. Globally, an estimated 48.9 million sepsis cases occur each year, and sepsis-related deaths account for approximately 19.7% of all deaths6. Despite advances in emergency and critical care, sepsis mortality remains substantial7. The Tokyo Guidelines 2018 (TG18) are widely used to diagnose and grade the severity of acute cholangitis2. However, identifying concomitant sepsis and predicting adverse outcomes remain challenging14. Improved risk-stratification approaches may therefore help identify patients who warrant closer assessment.

Previous studies have identified hematologic indices and measures of hepatic and renal function as potential markers of acute cholangitis severity and prognosis8. The Sequential Organ Failure Assessment (SOFA) score is widely used to quantify organ dysfunction and has prognostic value in sepsis9. Acute Physiology Score III (APS III), the acute physiology component of APACHE III, summarizes physiologic derangement and contributes to mortality-risk assessment in ICU patients10. Comorbidities such as cardiovascular disease, diabetes, and chronic liver disease may further increase the risk of adverse outcomes11. Nevertheless, evidence remains limited regarding outcome-specific prediction models for sepsis and mortality in acute cholangitis.

Machine learning has increasingly been applied to structured clinical data to identify complex patterns and support risk estimation12,13. Accordingly, we developed and internally validated interpretable machine-learning models for three distinct tasks: general-ward sepsis prediction, general-ward in-hospital mortality prediction, and ICU 28-day mortality prediction. We compared LR, RF, SVM, and XGBoost and used SHAP to quantify feature importance and explain individual predictions. The objective was to evaluate outcome-specific predictive performance and model interpretability, rather than to establish a clinical decision-making system. Prospective multicenter external validation is required before these models can be considered for routine clinical use.

Access restricted. Please log in or start a trial to view this content.

Protocol

This study was performed in line with the principles of the Declaration of Helsinki. Approval was granted by the Ethics Committee of Binhai County People's Hospital (Approval No. 2024-BHKYLL-055).

Methodology

Patients

We retrospectively enrolled 1,999 adults diagnosed with acute cholangitis at two centers between January 2020 and August 2024: Binhai County People's Hospital and Huai'an Second People's Hospital. Of these patients, 1,561 were managed in general wards, and 438 were admitted to the ICU. The study protocol was approved by the Ethics Committee of Binhai County People's Hospital (Approval No. 2024-BHKYLL-055). Written informed consent was obtained from each participant or a legally authorized representative.

Patients were eligible if they (1) had a physician-confirmed diagnosis of acute cholangitis, (2) were aged 18 years or older, and (3) had complete medical records and follow-up data for the relevant outcome.

Patients were excluded if they (1) had a concurrent malignancy expected to substantially affect survival, (2) were unable to provide informed consent, or (3) were lost to follow-up.

Clinical data collection and follow-up

Clinical characteristics and laboratory data were retrospectively extracted from the medical records of Binhai County People's Hospital and Huai'an Second People's Hospital. Demographic and medical-history variables included sex, age, cardiovascular disease, diabetes, hepatitis, cirrhosis, hyperlipidemia, and stroke. The first available laboratory measurements after admission to the general ward or ICU included white blood cell count (WBC), platelet count (PLT), hemoglobin (Hb), albumin, sodium, potassium, chloride, lactate (Lac), total bilirubin (TBil), alanine aminotransferase (ALT), aspartate aminotransferase (AST), creatinine (CR), and blood urea nitrogen (BUN). Recorded interventions included biliary stent placement, endoscopic retrograde cholangiopancreatography (ERCP), and percutaneous drainage. Disease-severity measures included the SOFA score, APS III, and the requirement for mechanical ventilation. Blood specimens were processed using standardized automated laboratory procedures. Patients discharged alive were followed through outpatient visits or telephone contact when follow-up was required. Sepsis status was assessed throughout hospitalization according to Sepsis-3 criteria; the sepsis group therefore included patients with sepsis at admission and those who developed sepsis later. Because the exact onset time of sepsis was unavailable and hospital length of stay was retained in the final general-ward sepsis model, a uniform prospective admission-time prediction landmark could not be established for that model. It should therefore be interpreted as a retrospective in-hospital risk-stratification model.

Outcome

The study evaluated three related but distinct prediction tasks. The primary outcome was sepsis status during hospitalization among general-ward patients with acute cholangitis, as determined using Sepsis-3 criteria. The secondary outcomes were all-cause in-hospital mortality in the general-ward cohort, defined as death before discharge, and all-cause 28-day mortality in the ICU cohort, defined as death within 28 days after ICU admission.

Statistical analysis

The distribution of each continuous variable was assessed using the Shapiro-Wilk test. Normally distributed variables were presented as the mean ± standard deviation and were compared using the independent-samples Student's t-test; Welch's t-test was used when the homogeneity-of-variance assumption was not met. Non-normally distributed variables were presented as the median and interquartile range (IQR) and were compared using the Wilcoxon rank-sum test. Categorical variables were presented as counts and percentages and compared using the chi-square or Fisher's exact test, as appropriate. All tests were two-sided, and P < 0.05 was considered statistically significant.

Patients were stratified according to the presence or absence of sepsis. In the general-ward cohort, multivariable logistic regression was used to identify factors associated with sepsis; results are reported as odds ratios (ORs) with 95% confidence intervals (CIs). Kaplan-Meier curves and log-rank tests were used to compare in-hospital survival in the general-ward cohort and 28-day survival in the ICU cohort between patients with and without sepsis. Cox proportional hazards models were fitted separately for the two cohorts, and results are reported as hazard ratios (HRs) with 95% CIs.

Four progressively adjusted Cox models were constructed. Model 1 was unadjusted. Model 2 was adjusted for age and sex. Model 3 was additionally adjusted for hypertension, diabetes, heart failure, stroke, and kidney injury. In the general-ward cohort, Model 4 was further adjusted for WBC, Hb, PLT, albumin, CR, BUN, AST, ALT, sodium, potassium, chloride, and Lac. In the ICU cohort, Model 4 additionally included APS III and SOFA because these severity scores were available only for ICU patients.

For each prediction task, a fixed random seed of 500 was used to divide the corresponding complete-case dataset into training and internal-validation cohorts at a 7:3 ratio. All feature-selection procedures were conducted exclusively in the training cohort; the internal-validation cohort was not used for predictor selection. Within the training cohort, LASSO regression with 10-fold cross-validation and the Boruta algorithm were used to identify candidate predictors. For LASSO, predictors with nonzero coefficients at lambda.min were retained. Boruta was run independently for up to 5,000 iterations. The resulting candidate predictors were used consistently to develop four models for each task: LR, RF, SVM, and XGBoost. Binary clinical variables were encoded as 0 or 1. No manual normalization or transformation was applied before fitting LR, RF, or XGBoost. Scaling for LASSO and SVM followed the default settings of their respective software implementations, and preprocessing parameters derived from the training cohort were applied unchanged to the internal validation cohort. No oversampling, undersampling, synthetic minority oversampling technique, or manually specified class weighting was used. The best-performing model was defined as the model with the highest overall internal-validation performance among the four prespecified implementations, rather than a fully optimized version of each algorithm. The fitted training-cohort models were then evaluated in the internal-validation cohort. The complete workflow is shown in Supplementary Figure 1, and implementation details are provided in Supplementary Table 1.

Model performance was evaluated using the area under the receiver operating characteristic curve (AUC), sensitivity, specificity, recall, F1 score, and accuracy. AUC summarizes discrimination across all possible classification thresholds, with 0.5 indicating no discrimination and 1.0 indicating perfect discrimination. At the selected threshold, true positives (TP) and true negatives (TN) were correctly classified positive and negative cases, whereas false positives (FP) and false negatives (FN) were incorrectly classified cases. Sensitivity, equivalent to recall in binary classification, was calculated as TP/(TP + FN); specificity as TN/(TN + FP); precision as TP/(TP + FP); F1 score as 2 × precision × recall/(precision + recall); and accuracy as (TP + TN)/(TP + TN + FP + FN). The positive classes were sepsis (coded as 1) for the general-ward sepsis prediction model, in-hospital death (coded as 1) for the general-ward in-hospital mortality model, and death within 28 days (coded as 1) for the ICU 28-day mortality model. The corresponding negative classes were absence of sepsis, discharge alive, and survival at 28 days (all coded as 0), respectively.

Four supervised machine-learning algorithms were selected to represent complementary strategies for structured clinical data. LR served as an interpretable reference model for additive linear associations. RF represented a bagging-based ensemble capable of modeling nonlinear relationships and interactions while reducing variance. SVM represented a margin-based classifier capable of accommodating nonlinear decision boundaries in moderately sized datasets. XGBoost represented a regularized boosting algorithm capable of capturing higher-order interactions and nonlinear patterns. All algorithms used the same candidate predictor set and were evaluated in the same training and internal-validation cohorts for each prediction task.

SHAP analysis was performed for the best-performing model for each outcome to quantify global feature importance and explain individual predictions. Nomogram development followed outcome-specific procedures. For the general-ward sepsis outcome, candidate predictors were entered into a multivariable logistic regression model, and variables that remained statistically significant at P < 0.05 were incorporated into the final nomogram. For the two mortality outcomes, predictor inclusion was based on the global SHAP feature-importance results of the corresponding best-performing models, without additional P-value-based elimination.

During retrospective database assembly, records missing clinical, laboratory, or outcome data required for the relevant analysis were excluded before entry into the final analytical dataset. A detailed pre-entry screening log was not retained; therefore, the number of records excluded due to missing data and the original variable-level patterns of missingness could not be reconstructed. The finalized general-ward cohort (n = 1,561) and ICU cohort (n = 438) contained no missing values for the variables used in the corresponding analyses (0% missing), and no statistical imputation was performed. All 1,561 general-ward patients were included in the sepsis and in-hospital mortality analyses, and all 438 ICU patients were included in the 28-day mortality analysis. Variable-level completeness in the finalized datasets is reported in Supplementary Table 2.

Machine-learning analyses were conducted using the machine-learning analysis platform. Conventional statistical analyses were performed using an open-source statistical computing environment and Statistical software. All statistical tests were two-sided, and P < 0.05 was considered statistically significant.

Access restricted. Please log in or start a trial to view this content.

Results

Baseline characteristics of the study cohorts

The study included 1,999 patients hospitalized with acute cholangitis: 1,561 in the general-ward cohort and 438 in the ICU cohort. In the general-ward cohort, 544 patients developed or had sepsis, and 1,017 did not; in the ICU cohort, 299 patients had sepsis, and 139 did not. Baseline characteristics stratified by sepsis status are presented in Table 1. In the general-ward cohort, patients with sepsis were older an...

Access restricted. Please log in or start a trial to view this content.

Discussion

Acute cholangitis is a potentially life-threatening biliary tract infection. Although mild disease often responds well to treatment, reported mortality can reach 50% in severe cases1,5. Mortality may approach 40% when septic shock develops14. Sepsis indicates that infection is no longer confined to the biliary tract and may progress rapidly to systemic inflammation and multiorgan dysfunction. Identifying factors associated with sepsis and ...

Access restricted. Please log in or start a trial to view this content.

Disclosures

The authors declare that they have no competing financial or nonfinancial interests. ChatGPT (OpenAI) was used during manuscript revision to assist with language editing, grammar, clarity, and organization. It was not used to generate or analyze study data or to draw scientific conclusions independently. All AI-assisted content was critically reviewed and verified by the authors, who take full responsibility for the accuracy, integrity, and originality of the manuscript. Consent to Participate: Written informed consent was obtained from all participants or their legally authorized representatives.

Acknowledgements

Thanks to all collaborators on this paper for their data analysis and writing. Funding: This work was supported by Jiangsu Medical College's 2024 Collaborative Innovation Research Project between the School and the Local Government (202491011,202491007). Changzhou Science and Technology Bureau (CJ20239026, CJ20244028).

Access restricted. Please log in or start a trial to view this content.

Materials

List of materials used in this article
NameCompanyCatalog NumberComments
Boruta (R package)[version/CRAN]Feature-selection algorithm run within the training cohort
glmnet / LASSO (R package)[version/CRAN]LASSO regression with 10-fold cross-validation for feature selection
RR Foundation for Statistical Computingversion 4.3.2Open-source statistical computing environment
SHAP implementation[version]Shapley Additive Explanations for model interpretation
StataStataCorpversion 17.0Statistical software for conventional analyses
XGBoost implementation[version]Extreme Gradient Boosting model
Xsmart Analysis platform[version]Machine-learning analysis platform

References

  1. An Z, Braseth AL, Sahar N. Acute cholangitis: causes, diagnosis, and management. Gastroenterol Clin North Am. 2021;50:403–14.
  2. Gravito-Soares E, et al. Clinical applicability of Tokyo Guidelines 2018/2013 in diagnosis and severity evaluation of acute cholangitis and determination of a new severity model. Scand J Gastroenterol. 2018;53:329–34.
  3. Cianci P, Restini E. Management of cholelithiasis with choledocholithiasis: endoscopic and surgical approaches. World J Gastroenterol. 2021;27:4536–54.
  4. Lan Cheong Wah D, Christophi C, Muralidharan V. Acute cholangitis: current concepts. ANZ J Surg. 2017;87:554–59.
  5. Cecconi M, Evans L, Levy M, Rhodes A. Sepsis and septic shock. Lancet. 2018;392:75–87.
  6. Rudd KE, et al. Global, regional, and national sepsis incidence and mortality, 1990–2017: analysis for the Global Burden of Disease Study. Lancet. 2020;395:200–11.
  7. Xie J, et al. The epidemiology of sepsis in Chinese ICUs: a national cross-sectional survey. Crit Care Med. 2020;48:e209–e218.
  8. Wilkins T, Agabin E, Varghese J, Talukder A. Gallbladder dysfunction: cholecystitis, choledocholithiasis, cholangitis, and biliary dyskinesia. Prim Care. 2017;44:575–97.
  9. Qiu X, Lei YP, Zhou RX. SIRS, SOFA, qSOFA, and NEWS in the diagnosis of sepsis and prediction of adverse outcomes: a systematic review and meta-analysis. Expert Rev Anti Infect Ther. 2023;21:891–900.
  10. Knaus WA, et al. The APACHE III prognostic system: risk prediction of hospital mortality for critically ill hospitalized adults. Chest. 1991;100:1619–36.
  11. Pötter-Lang S, et al. Modern imaging of cholangitis. Br J Radiol. 2021;94:20210417. doi:10.1259/bjr.20210417.
  12. Banerjee S. Generating complex explanations for artificial intelligence models: an application to clinical data on severe mental illness. Life (Basel). 2024;14:807. doi:10.3390/life14070807.
  13. Karako K, Tang W. Applications of and issues with machine learning in medicine: bridging the gap with explainable AI. Biosci Trends. 2024;18:497–504.
  14. Beliaev AM, Zyul'korneeva S, Rowbotham D, Bergin CJ. Screening acute cholangitis patients for sepsis. ANZ J Surg. 2019;89:1457–61.
  15. Fathi M, Markazi-Moghaddam N, Ramezankhani A. A systematic review on risk factors associated with sepsis in patients admitted to intensive care units. Aust Crit Care. 2019;32:155–64.
  16. Liu Q, et al. A nomogram for predicting the risk of sepsis in patients with acute cholangitis. J Int Med Res. 2020;48:300060519866100. doi:10.1177/0300060519866100.
  17. Singer M, et al. The third international consensus definitions for sepsis and septic shock (Sepsis-3). JAMA. 2016;315:801–10.
  18. Joffre J, Hellman J, Ince C, Ait-Oufella H. Endothelial responses in sepsis. Am J Respir Crit Care Med. 2020;202:361–70.
  19. Mitchell E, Pearce MS, Roberts A. Gram-negative bloodstream infections and sepsis: risk factors, screening tools and surveillance. Br Med Bull. 2019;132:5–15.
  20. Fan S, Ma J. The value of five scoring systems in predicting the prognosis of patients with sepsis-associated acute respiratory failure. Sci Rep. 2024;14:4760. doi:10.1038/s41598-024-55257-5.
  21. Pérez-Fernández X, et al. Clinical variables associated with poor outcome from sepsis-associated acute kidney injury and the relationship with timing of initiation of renal replacement therapy. J Crit Care. 2017;40:154–60.
  22. Lambden S, Laterre PF, Levy MM, François B. The SOFA score—development, utility and challenges of accurate assessment in clinical trials. Crit Care. 2019;23:374. doi:10.1186/s13054-019-2663-7.
  23. Inan O, Sahiner ES, Ates I. Factors associated with clinical outcome in geriatric acute cholangitis patients. Eur Rev Med Pharmacol Sci. 2023;27:3313–21.
  24. Bakker J, Postelnicu R, Mukherjee V. Lactate: where are we now? Crit Care Clin. 2020;36:115–24.
  25. Brooks GA. The science and translation of lactate shuttle theory. Cell Metab. 2018;27:757–85.
  26. Salek J, Livote E, Sideridis K, Bank S. Analysis of risk factors predictive of early mortality and urgent ERCP in acute cholangitis. J Clin Gastroenterol. 2009;43:171–75.
  27. Schneider J, et al. Mortality risk for acute cholangitis (MAC): a risk prediction model for in-hospital mortality in patients with acute cholangitis. BMC Gastroenterol. 2016;16:15. doi:10.1186/s12876-016-0428-1.
  28. Lee TW, et al. Incidence, risk factors, and prognosis of acute kidney injury in hospitalized patients with acute cholangitis. PLoS One. 2022;17:e0267023. doi:10.1371/journal.pone.0267023.

Access restricted. Please log in or start a trial to view this content.

Reprints and Permissions

Explore More Articles

Sepsis PredictionLogistic RegressionRandom ForestSupport Vector MachineXGBoost ModelSHAP Interpretation