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 and had higher potassium, AST, CR, and BUN values than patients without sepsis (all P < 0.05), whereas Hb, PLT, and albumin were lower (all P < 0.05). Diabetes, heart failure, hyperlipidemia, kidney injury, and longer hospital stay were more common or greater among patients with sepsis (all P < 0.05); stroke, hypertension, and hepatitis did not differ significantly between groups. In the ICU cohort, patients with sepsis had higher potassium, TBil, AST, CR, and BUN and lower albumin than patients without sepsis (all P < 0.05). Kidney injury and longer ICU stay were also associated with sepsis status (P < 0.05), whereas the other evaluated comorbidities did not differ significantly. SOFA and APS III scores were higher in ICU patients with sepsis than in those without sepsis (both P < 0.05).
Feature selection for general-ward sepsis prediction
The general-ward dataset was divided into a training cohort of 1,092 patients and an internal-validation cohort of 469 patients. For the sepsis outcome, the training cohort included 380 patients with sepsis and 712 without sepsis, and the internal-validation cohort included 164 patients with sepsis and 305 without sepsis. For general-ward in-hospital mortality, the training cohort included 56 deaths and 1,036 survivors, and the internal-validation cohort included 24 deaths and 445 survivors. The ICU training cohort included 306 patients (76 deaths within 28 days and 230 survivors), and the internal-validation cohort included 132 patients (33 deaths and 99 survivors at 28 days). For general-ward sepsis prediction, 27 variables were initially considered. Boruta classified variables as confirmed important, tentative, or rejected (Figure 1A). Eleven variables were classified as important: albumin, kidney injury, hospital length of stay, CR, WBC, PLT, heart failure, age, and Hb. LASSO regression with 10-fold cross-validation retained 19 candidate features (Figures 1B,C). The feature-selection results and clinical relevance were then considered together, yielding 11 candidate predictors: BUN, CR, WBC, PLT, age, heart failure, albumin, kidney injury, hospital length of stay, Hb, and cirrhosis.
Model comparison and SHAP interpretation for general-ward sepsis prediction
LR, RF, SVM, and XGBoost were compared for the general-ward sepsis prediction task using the same training and internal-validation cohorts (Figure 2). The training-cohort AUCs were 0.893 for LR, 0.853 for RF, 0.718 for SVM, and 0.767 for XGBoost; the corresponding internal-validation AUCs were 0.826, 0.787, 0.647, and 0.737, respectively (Figure 2A,B). LR achieved the highest internal-validation AUC and the best overall performance among the four evaluated models and was therefore selected for further interpretation. Detailed performance measures are provided in Supplementary Table 3. Within the evaluated threshold-probability range, decision-curve analysis indicated a greater net benefit for LR (Figure 2D), and the calibration plot showed agreement between predicted and observed sepsis probabilities (Figure 2E). These findings are based on internal validation and do not establish readiness for routine clinical implementation.
SHAP analysis was used to interpret the selected LR model. Figure 2C,F show global predictor contributions, with predictors ordered by their overall influence on model estimates. In descending order of importance, the predictors were BUN, CR, WBC, PLT, age, heart failure, albumin, kidney injury, hospital length of stay, Hb, and cirrhosis. Figure 2G provides a patient-level force plot. Red features increased the estimated probability of sepsis, whereas blue features decreased it. The term f(x) represents the model output for the individual relative to the baseline expectation.
Construction of the general-ward sepsis nomogram
Candidate predictors retained after feature selection were entered into a multivariable logistic regression model (Table 2). Variables that remained significant at P < 0.05 were incorporated into the final nomogram (Figure 3A): kidney injury, heart failure, WBC, PLT, albumin, and hospital length of stay. The nomogram yielded an AUC of 0.791 (Figure 3B), and the calibration plot showed agreement between predicted and observed sepsis probabilities (Figure 3C).
Association between sepsis and survival outcomes
Kaplan-Meier curves were used to compare survival according to sepsis status (Figure 4). In the ICU cohort, patients with sepsis had poorer 28-day survival than those without sepsis (Figure 4A; log-rank P < 0.001). In the general-ward cohort, patients with sepsis had poorer in-hospital survival than those without sepsis (Figure 4B; log-rank P < 0.001).
Four progressively adjusted Cox proportional hazards models were used to evaluate the association between sepsis and mortality (Table 3). In the general-ward cohort, sepsis was associated with in-hospital mortality in the unadjusted model (Model 1: HR, 4.48; 95% CI, 2.53-7.95; P < 0.001). The association remained after adjustment for age and sex (Model 2: HR, 4.11; 95% CI, 2.31-7.32; P < 0.001), additional comorbidities (Model 3: HR, 3.51; 95% CI, 1.94-6.35; P < 0.001), and laboratory variables (Model 4: HR, 2.18; 95% CI, 1.15-4.15; P = 0.018). In the ICU cohort, sepsis was associated with 28-day mortality in Model 1 (HR, 5.94; 95% CI, 3.00-11.76; P < 0.001), Model 2 (HR, 5.89; 95% CI, 2.98-11.67; P < 0.001), Model 3 (HR, 4.81; 95% CI, 2.41-9.61; P < 0.001), and Model 4 (HR, 4.54; 95% CI, 2.22-9.29; P < 0.001). These findings were consistent with the Kaplan-Meier analyses.
Feature selection for the mortality models
Boruta and LASSO were used to select candidate predictors for general-ward in-hospital mortality and ICU 28-day mortality (Figure 5). For ICU 28-day mortality, Boruta identified 10 important variables, including APS III, TBil, PLT, ALT, sepsis status, and Hb (Figure 5A). LASSO with 10-fold cross-validation retained 15 candidate features (Figures 5B,C). Considering both feature-selection procedures and clinical relevance, eight predictors were retained: APS III, Hb, ALT, Lac, TBil, sepsis status, kidney injury, and albumin. For general-ward in-hospital mortality, six predictors were retained: albumin, kidney injury, sepsis status, BUN, TBil, and AST (Figures 5D–F).
Model comparison and SHAP interpretation for the mortality outcomes
LR, RF, SVM, and XGBoost were compared for ICU 28-day mortality using the corresponding training and internal-validation cohorts (Figure 6). The training-cohort AUCs were 0.831 for LR, 0.883 for RF, 0.481 for SVM, and 0.862 for XGBoost; the corresponding internal-validation AUCs were 0.773, 0.810, 0.322, and 0.805, respectively (Figures 6A,B). RF was selected as the best-performing model based on its validation AUC and overall performance metrics. Detailed results are provided in Supplementary Table 4. Within the evaluated threshold-probability range, decision-curve analysis indicated a potential net benefit for RF (Figure 6D), whereas calibration showed only moderate agreement between predicted and observed 28-day mortality probabilities (Figure 6E). Global SHAP analyses ranked predictors as follows: APS III, Hb, ALT, Lac, TBil, albumin, sepsis status, and kidney injury (Figures 6C,F). Figure 6G presents a representative patient-level explanation.
For general-ward in-hospital mortality, the training-cohort AUCs were 0.951 for LR, 0.873 for RF, 0.641 for SVM, and 0.902 for XGBoost; the corresponding internal-validation AUCs were 0.900, 0.829, 0.564, and 0.871, respectively (Figures 7A,B). LR achieved the highest internal-validation AUC and was selected as the best-performing model. Detailed results are provided in Supplementary Table 4. Within the evaluated threshold-probability range, decision-curve analysis indicated a potential net benefit for LR (Figure 7D), and calibration showed moderate agreement between predicted and observed in-hospital mortality probabilities (Figure 7E). Global SHAP analyses ranked predictors as follows: albumin, kidney injury, sepsis status, BUN, TBil, and AST (Figures 7C,F). Figure 7G presents a representative patient-level explanation.
Construction of the ICU 28-day mortality and general-ward in-hospital mortality nomograms
Separate nomograms were constructed using predictors prioritized by global SHAP feature importance in the best-performing mortality models (Figure 8). The ICU 28-day mortality nomogram incorporated APS III, Hb, ALT, Lac, TBil, albumin, sepsis status, and kidney injury (Figure 8A). It yielded an AUC of 0.840 (Figure 8B), and calibration showed agreement between predicted and observed 28-day mortality probabilities within the study cohort (Figure 8C). The general-ward in-hospital mortality nomogram incorporated albumin, kidney injury, sepsis status, BUN, TBil, and AST (Figure 8D). It yielded an AUC of 0.904 (Figure 8E), and calibration showed agreement between predicted and observed in-hospital mortality probabilities within the study cohort (Figure 8F). Because these estimates were derived solely from internal validation, they should be considered preliminary and require confirmation in independent external cohorts.
Assessment of model complexity relative to outcome events
Model complexity was assessed by comparing the number of outcome events in each training cohort with the number of predictors in the corresponding final nomogram. The general-ward sepsis prediction model included 380 sepsis events and six predictors (63.3 events per predictor). The general-ward in-hospital mortality model included 56 deaths and six predictors (9.3 events per predictor), and the ICU 28-day mortality model included 76 deaths and eight predictors (9.5 events per predictor). Thus, event support was substantial for the sepsis model but more limited for the two mortality models, which were close to the commonly cited rule of thumb of approximately 10 events per predictor.
DATA AVAILABILITY:
All anonymized patient-level data used in this study are publicly available in the supplementary files attached to this article. Supplementary Table 5 contains the data of the general ward cohort, and Supplementary Table 6 contains the data of the intensive care unit cohort. Before submission, all direct personal identification information and other potentially identifiable information have been removed.

Figure 1: Feature selection for the general-ward sepsis prediction model in patients with acute cholangitis. (A) Boruta feature-selection analysis; (B,C) LASSO coefficient-path and 10-fold cross-validation analyses. Please click here to view a larger version of this figure.

Figure 2: Comparison and interpretation of machine-learning models for general-ward sepsis prediction in patients with acute cholangitis. (A,B) ROC curves for the candidate machine-learning models in the training and internal-validation cohorts; (C,F) global SHAP analyses of predictor contributions; (D) decision-curve analysis; (E) calibration curves; (G) individual SHAP explanation for a representative patient. Please click here to view a larger version of this figure.

Figure 3: Construction and evaluation of the general-ward sepsis prediction nomogram. (A) Nomogram; (B) ROC curve; (C) calibration curve. Please click here to view a larger version of this figure.

Figure 4: Kaplan–Meier survival curves for patients with acute cholangitis stratified by sepsis status. (A) Comparison of 28-day survival between patients with and without sepsis in the ICU cohort; (B) comparison of in-hospital survival between patients with and without sepsis in the general-ward cohort. Please click here to view a larger version of this figure.

Figure 5: Feature selection for the ICU 28-day mortality and general-ward in-hospital mortality models. (A) Boruta feature-selection analysis for ICU 28-day mortality; (B,C) LASSO coefficient-path and 10-fold cross-validation analyses for ICU 28-day mortality; (D) Boruta feature-selection analysis for general-ward in-hospital mortality; (E,F) LASSO coefficient-path and 10-fold cross-validation analyses for general-ward in-hospital mortality. Please click here to view a larger version of this figure.

Figure 6: Comparison and interpretation of machine-learning models for ICU 28-day mortality in patients with acute cholangitis. (A,B) ROC curves for the candidate machine-learning models in the training and internal-validation cohorts; (C,F) global SHAP analyses of predictor contributions; (D) decision-curve analysis; (E) calibration curves; (G) individual SHAP explanation for a representative patient. Please click here to view a larger version of this figure.

Figure 7: Comparison and interpretation of machine-learning models for general ward in-hospital mortality in patients with acute cholangitis. (A,B) ROC curves for the candidate machine-learning models in the training and internal-validation cohorts; (C,F) global SHAP analyses of predictor contributions; (D) decision-curve analysis; (E) calibration curves; (G) individual SHAP explanation for a representative patient. Please click here to view a larger version of this figure.

Figure 8: Construction and evaluation of the ICU 28-day mortality and general-ward in-hospital mortality nomograms. (A–C) Nomogram, ROC curve, and calibration curve for ICU 28-day mortality; (D–F) nomogram, ROC curve, and calibration curve for general-ward in-hospital mortality. Please click here to view a larger version of this figure.
Table 1: Baseline characteristics of the included patients. Clinical and laboratory characteristics are presented separately for the general-ward and ICU cohorts and compared between patients with and without sepsis. Please click here to download this file.
Table 2: Multifactorial analysis of sepsis in patients with cholangitis. Abbreviations: WBC: white blood cell; PLT: platelet. Numbers indicating p-values less than 0.05 are bolded. Please click here to download this file.
Table 3: The relationship between sepsis and the prognosis of patients with cholangitis. Model 1 was unadjusted. Model 2 was adjusted for age and sex. Model 3 was further adjusted for hypertension, diabetes, heart failure, stroke, and kidney injury. For the general-ward cohort. Model 4 was additionally adjusted for WBC, Hb, PLT, albumin, CR, BUN, AST, ALT, sodium, potassium, chloride, and Lac. For the ICU cohort, Model 4 was additionally adjusted for APS III, SOFA, WBC, Hb, PLT, albumin, CR, BUN, AST, ALT, sodium, potassium, chloride, and Lac. HR, hazard ratio; CI, confidence interval; APS III, Acute Physiology and Chronic Health Evaluation III; SOFA, Sequential Organ Failure Assessment; WBC, white blood cell count; Hb, hemoglobin; PLT, platelet count; CR, creatinine; BUN, blood urea nitrogen; AST, aspartate aminotransferase; ALT, alanine aminotransferase; Lac, lactate. Bold values indicate statistical significance at P < 0.05. Please click here to download this file.
Supplementary Figure 1: Overall study and machine-learning workflow. Patients with acute cholangitis were separated into general-ward and ICU cohorts, and three prediction tasks were defined: general-ward sepsis, general-ward in-hospital mortality, and ICU 28-day mortality. For each task, the data were divided into training and internal-validation cohorts at a 7:3 ratio before feature selection. LASSO and Boruta were performed exclusively in the training cohort, after which LR, RF, SVM, and XGBoost were developed and compared. The best-performing model was selected based on internal validation performance and interpreted using SHAP. The general-ward sepsis nomogram used variables retained in multivariable logistic regression, whereas the mortality nomograms used predictors prioritized by global SHAP feature importance.Please click here to download this file.
Supplementary Table 1: Detailed computational implementation, preprocessing procedures, feature-selection settings, and machine-learning model parameters. Abbreviations: AUC, area under the receiver operating characteristic curve; FN, false negative; FP, false positive; ICU, intensive care unit; LASSO, least absolute shrinkage and selection operator; LR, logistic regression; RF, random forest; SHAP, Shapley Additive Explanations; SMOTE, synthetic minority oversampling technique; SVM, support vector machine; TN, true negative; TP, true positive; XGBoost, Extreme Gradient Boosting. Note: The machine-learning analyses were originally performed through a cloud-based platform. Because the platform was subsequently upgraded, exact historical backend package build numbers were no longer accessible; therefore, current Python package versions could not be retroactively reported as the versions used in the original analyses. The algorithm values shown above represent the documented preset parameter settings, not outcome-specific hyperparameter optimization.Please click here to download this file.
Supplementary Table 2: Variable-level data completeness in the finalized general-ward and ICU analytical datasets. The finalized datasets contained no missing values for the variables included in the corresponding analyses, and no statistical imputation was performed. Records missing required data were excluded during retrospective database assembly; the exact number of pre-entry exclusions and the original patterns of missingness were not retained.Please click here to download this file.
Supplementary Table 3: Performance of the candidate machine-learning models for general-ward sepsis prediction in patients with acute cholangitis. Evaluation of the effectiveness of machine learning models in predicting sepsis in patients with acute cholangitis.Please click here to download this file.
Supplementary Table 4: Performance of the candidate machine-learning models for general-ward in-hospital mortality and ICU 28-day mortality in patients with acute cholangitis. Performance of LR, RF, SVM, and XGBoost is summarized for the training and internal-validation cohorts using AUC, sensitivity, specificity, recall, F1 score, and accuracy.Please click here to download this file.
Supplementary Table 5: Anonymized patient-level data for the general-ward cohort. The dataset contains the clinical and laboratory variables used in the analyses of sepsis and in-hospital mortality.Please click here to download this file.
Supplementary Table 6: Anonymized patient-level data for the ICU cohort. The dataset contains the clinical and laboratory variables used to analyze 28-day mortality.Please click here to download this file.