Machine learning-based nomogram for 30-day mortality prediction for patients with unresectable malignant biliary obstruction after ERCP with metal stent: a retrospective observational cohort study

Background This study aimed to investigate the risk factors for 30-day mortality in patients with malignant biliary obstruction (MBO) after endoscopic retrograde cholangiopancreatography (ERCP) with endobiliary metal stent placement. Furthermore, we aimed to construct and visualize a prediction model based on LASSO-logistic regression. Methods Data were collected from 245 patients who underwent their first ERCP with endobiliary metal stent placement for unresectable MBO between June 1, 2013, and August 31, 2021. Univariable and multivariable logistic regression analyses were conducted to identify the risk factors for 30-day mortality. We subsequently developed a logistic regression model that incorporated multiple parameters identified by LASSO regression. The model was visualized and the nomogram was plotted. Risk stratification was performed based on nomogram-derived scores. Results The 30-day mortality rate was 10.7% (23/245 patients). Distant metastasis, total bilirubin, post-ERCP complications, and successful drainage were independent risk factors of 30-day mortality. The variables screened by LASSO regression, including distant metastasis, total bilirubin, post-ERCP complications, and successful drainage, were incorporated into the logistic model. The results were visualized through a nomogram based on the model. To assess the model’s performance, discrimination was evaluated using the area-under-the-curve values obtained from receiver operating characteristic analyses with 10-fold cross-validation in the training group and validated in the testing group. The calibration curve showed the good predictive ability of the model. Decision curve analysis is used to evaluate the clinical application of nomogram. Finally, we performed risk stratification based on the risk calculated using the nomogram. Patients were assigned to the low-, moderate-, and high-risk groups based on their probability scores. The Kaplan–Meier survival curves for the different nomogram-based groups were significantly different (p < 0.001). Conclusions We developed a nomogram using the LASSO-logistic regression model to forecast the 30-day mortality rate in patients who had undergone ERCP with endobiliary metal stent placement due to MBO. This nomogram can assist in identifying individuals at high-risk of 30-day mortality following ERCP.


Background
Malignant biliary obstruction (MBO) is caused by the direct invasion or compression of the bile duct by pancreatic cancer, cholangiocarcinoma, gallbladder cancer, hepatocellular carcinoma, ampullary cancer, and metastasis from other primary lesions [1].Surgical resection is the only curative treatment.However, due to the lack of obvious pre-disease symptoms, patients with MBO usually present at advanced and unresectable stages at diagnosis [2,3].These patients often have jaundice, itching, discomfort, anorexia, and weight loss, which seriously affect their quality of life [2,[4][5][6].Additionally, chemotherapy initiation is frequently postponed to minimize the risk of hepatotoxicity caused by biliary stasis-induced liver function impairment [7][8][9][10].Furthermore, patients diagnosed with unresectable MBO frequently have a poor prognosis, with a five-year survival rate typically below 5% [2,5,11].
Endoscopic retrograde cholangiopancreatography (ERCP)-guided endobiliary drainage with stent placement is the primary therapeutic approach to alleviate symptoms and facilitate chemotherapy for patients with unresectable MBO.This treatment has low invasiveness, high efficacy, high patient acceptance, and relatively low complication and mortality rates [10].In addition, restoring bile circulation conforms to human physiology, thereby avoiding electrolyte disturbances caused by extracorporeal bile drainage [10,12].Its survival rates are better when compared with percutaneous transhepatic bile duct drainage and surgical drainage [13][14][15].
Nevertheless, ten percent of patients with unresectable MBO still have poor outcomes after stent placement, with some patients having elevated total bilirubin (TB) levels or dying within 30 days after surgery [16].Therefore, it is important to assess the risk factors influencing 30-day mortality.However, few studies have been conducted in this area.Bilirubin sludge damages hepatocytes and affects the metabolic, immune, and coagulation functions of the liver, which may contribute to poor patient outcomes.Several clinical studies have investigated the predictors of mortality following endoscopic endobiliary stent placement, but these studies have utilized univariable and multivariable analyses, which may have limitations in handling multicollinearity between variables [17][18][19].Machine learning (ML) is a scientific discipline concerning how computers learn from data [20].The use of ML has significant value in clinical research because it helps us to accurately search for risk factors leading to target outcome events from a multitude of clinical parameters, eliminating manual aspects of data omission, multicollinearity, and statistical overfitting problems [21].
The primary objective of this study was to investigate the clinical predictors of 30-day mortality in patients who underwent ERCP with endobiliary metal stent placement.A 30-day mortality prediction model was developed and internally validated.This study further aimed to help clinicians distinguish patients with high-risk factors and to improve palliative care selection by developing predictive models.

Patient selection
This single-center, retrospective, observational cohort study was conducted at the First Hospital of Jiaxing.Eligible patients underwent their first ERCP with endobiliary metal stent placement for unresectable MBO between June 1, 2013, and August 31, 2021.Eighty percent of the data were randomly classified as the training cohort and the remaining 20% were used as the test cohort.The analyzed variables included sex, age, obstruction site, cholangitis before stent insertion, post-ERCP complications, Child-Pugh classification, ascites, white blood cell count, red blood cell count, type of malignancy, hemoglobin, platelet, prothrombin time (PT), TB, albumin, alanine aminotransferase (ALT), aspartate aminotransferase (AST), creatinine, distant metastasis, lymph node metastasis, stent placement, successful drainage, and survival in days.The follow-up ended in December 2021, and the primary endpoint was 30-day mortality, which was calculated as the interval between the date of surgery and the date of death.
The inclusion criteria were as follows: (a) patients diagnosed with malignant tumors by pathological or imaging examination that did not undergo surgery owing to tumor invasion; (b) patients with primary and secondary malignancies of the liver, bile duct, gallbladder, pancreas, or periampullary malignant tumors; (c) age ≥ 18 years; (d) patients who underwent their first ERCP with endobiliary metal stent placement.
The exclusion criteria were as follows: (a) patients with a resectable stage of disease; (b) patients with a history of previous cholecystectomy; (c) patients who had < 30 days of follow-up owing to transfer to other hospital or other causes; (d) patients with failed cannulation or no stent placement.
All pertinent clinical and laboratory data before and after the ERCP were gathered.Additionally, the crosssectional images and cholangiographic findings were reviewed.In cases where histological analyses were not possible, the diagnosis of MBO was based on a combination of imaging and clinical follow-up or histopathology alone.Patient selection flow is presented in Fig. 1.

Endoscopic procedures for ERCP
Each patient underwent imaging, including computed tomography and magnetic resonance imaging, before biliary stent placement to plan effective drainage.All ERCPs were performed by doctors who had performed at least 200 ERCP procedures per year.Patients fasted for 8 h before surgery.General anesthesia was administered without tracheal intubation.Duodenoscopy was performed through the esophagus, stomach, and descending duodenum.A catheter was inserted at the duodenal papilla opening.Cholangiography was performed by attempting to aspirate bile, followed by a slow injection of iohexol.The level and length of the obstruction were clarified.Endoscopic sphincterotomy or papillary balloon dilation before biliary stent placement was allowed at the discretion of the endoscopist.ERCP was predominantly performed under sedation with intravenous midazolam or propofol in combination with Fig. 1 Detailed outline of patient screening process based on inclusion and exclusion criteria meperidine.After successful stent placement, bile was drained into the duodenum.Postoperative abdominal radiography was performed to observe stent position and patency.Prophylactic antibiotics were routinely administered before ERCP.
The patients fasted from food and water for 24 h after surgery.The abdominal symptoms and signs were observed closely.Blood amylase level was rechecked on postoperative day 1, and liver function was checked at least once on postoperative days 1-7 to confirm the resolution of jaundice.

Definitions
"High obstruction" refers to an obstruction between the common hepatic duct to the intrahepatic bile ducts; "Low obstruction" refers to an obstruction occurring in the common bile duct and far from the port hepatic.The 30-day mortality was defined as death within 30 days of ERCP.Successful drainage was defined as a decrease in TB of > 30% within 1 week after surgery or a total decrease in bilirubin in the later period close to the normal level (TB ≤ 17.1 μmol/L) [22].Postoperative complications were defined as any procedure-related adverse event that occurred within 2 weeks, including bleeding, cholangitis, hemorrhagic complications, pancreatitis, and gut or bile duct perforations.Overall survival was calculated from the day of the procedure until either the day of death or the last follow-up day.

Statistical methods
Our structured database contained 23 clinical variables.For data collection and processing, after completing statistical analysis and addressing missing data and noise, all predictive variables were standardized, Categorical variables are presented as percentages and numbers, while continuous variables are presented as mean ± standard deviation for normally distributed data and interquartile range (IQR) for skewed data.The chi-square test or Fisher's exact test were used for comparing categorical variables, while the independent t-test or Mann-Whitney U test were used for comparing continuous variables.A p-value < 0.05 was deemed significant.Univariable logistic regression was utilized to identify clinical variables that impacted the study outcomes, which were then compared between patients who survived and those who did not.Odds ratios (OR) and 95% confidence intervals (CIs) were calculated for each variable.Variables that were found to be significant in the univariable analysis were included in the multivariable logistic regression.Significant variables in the multiple logistic regression were considered independent risk factors potentially affecting the outcome.
To avoid model overfitting or underfitting, LASSO regression was used to filter the features.The variance inflation factor (VIF) was assessed among the filtered variables.Variables with VIF > 5.0 were interpreted as multicollinear and not included in the final model analysis.
The final logistic regression model was developed based on the results of the LASSO regression and VIF.To improve the clinical utility of the model, a nomogram was developed where the coefficient of each variable in the regression model was used to assign points for each variable on the nomogram.Points were assigned to each variable by dividing its coefficient by the smallest coefficient and then rounding to the nearest integer.The total points for each patient were calculated by adding up the points assigned to each variable for that patient.Finally, the probability of an event occurring was estimated by calculating the distance from the total points to the probability axis.
We utilized 10-fold cross-validation and plotted the receiver operating characteristic (ROC) curve to assess the model's discriminative ability and stability in the training cohort.Furthermore, the ROC curve was drawn for the test cohort to further assess the model's performance.The area under the curve (AUC) values can range from 0.5 to 1.0, with 0.5 representing random chance and 1.0 indicating a perfect fit.1000 bootstrap resampling iterations were employed separately in the training and testing cohorts to generate the calibration curve for the model.The calibration curve was then used to evaluate the model's calibration performance.Calibration curves are a useful tool for validating and optimizing the performance of classification models.These curves typically have two axes: the x-axis represents predicted probabilities and the y-axis represents observed probabilities.If the model's predictions match the actual observations, then the calibration curve should be close to the 45-degree diagonal line.If the curve is far from the 45-degree diagonal line, it indicates that the model has a bias.Additionally, decision curve analysis (DCA) is employed to assess the clinical utility of nomogram.
Considering the incidence rate of 30-day mortality events in patients, we classified patients into low-(below the 75th percentile), medium-(between the 75th and 90th percentiles), and high-(above the 90th percentile) risk groups based on their nomogram score percentile ranks.A Cox proportional hazards model was utilized to determine the hazard ratio and the probability of mortality based on the nomogram score groups.Cumulative survival rates over time were estimated using the Kaplan-Meier method.Statistical significance was set at a p-value < 0.05.All statistical analyses were performed using R version 4.21.

Baseline characteristics
Twenty-three of 245 patients survived for less than 30 days.The baseline characteristics between the groups are presented in Table 1.The study cohort comprised 245 patients, who were randomly divided into training (n = 204) and test (n = 41) cohorts (Table 2).
In the multivariable analysis (Table 3), the following factors were identified as significant predictors of death within 30 days after ERCP: distant metastasis (OR 7.96; 95% CI, 1.44-44.10;p = 0.018), post-ERCP complications (OR 6.03; 95% CI, 1.52-24.01;p = 0.011), TB (OR 1.01; 95% CI, 1.00-1.01;p = 0.009) and successful drainage (OR 0.12; 95% CI, 0.03-0.54;p = 0.005).The parameters were screened using LASSO regression, and the coefficient variation characteristics of these variables are presented in Fig. 2A.To achieve a model with excellent performance and minimum variables, a 5-fold cross-validation method was utilized for iterative analysis.The obtained model had a λ of 0.05019702 (Fig. 2B).The results of lasso regression are consistent with the results of multivariable analysis, which strongly confirms the reliability of the variable selection outcome.

Development of the 30-day mortality prediction nomogram
A nomogram was developed based on the LASSO regression.The VIF values were all < 5, indicating no collinearity between the screened variables.Figure 3 shows the nomogram, which was generated using a logistic regression model that included all significant independent prognostic factors for 30-day mortality in the training dataset.

Evaluation and validation of the nomogram
We evaluated the model using a 10-fold cross-validation and obtained the following results: the model's average AUC was 0.88 (standard deviation: 0.11).The ROC curves for 10 folds and the average ROC curve were plotted (Fig. 4A).These results indicate that the model has high accuracy and robustness in predicting the 30-day mortality of the patients, while maintaining a stable performance on different datasets.The ROC curve of the test set (Fig. 4B) had a AUC of 0.919 (95% CI: 0.818-1.000),further demonstrating the reliability of the results.After generating the calibration curve using 1000 iterations of Bootstrap resampling for both the training and test datasets (Fig. 5), we evaluated the calibration performance of the model using the calibration curve.Based on our evaluation, the model demonstrated good calibration performance.
DCA is utilized to evaluate the clinical utility of the model (Fig. 6).It demonstrates that the nomogram model exhibits higher net benefits across a wide range of threshold probabilities compared to both full treatment and no treatment scenarios.

Risk stratification based on the nomogram
Finally, we used the nomogram to perform risk stratification.Patients with probability total scores of < 90, 90-120, and ≥ 120 were assigned to the low-, moderate-, and high-risk groups, respectively.The proportionality hazard assumption was assessed using Schoenfeld residual analysis.In Fig. 7, the p-values for the risk groups were presented (Fig. 7A).The results indicated that the risk groups met the proportionality hazard assumption.Compared to the low-risk group, the middle-risk group and high-risk group had HRs of 8.41 (95% CI, 2.37-29.8;p < 0.001) and 34.53 (95% CI, 11.21-106.3;p < 0.001), respectively (Fig. 7B).
The Kaplan-Meier survival curves separated by nomogram-based grouping are depicted in Fig. 8, revealing a significantly lower 30-day mortality in the low-risk group compared to that of the high-risk group (p < 0.001).

Discussion
Our study demonstrates that post-ERCP complications, distant metastasis, TB, and successful drainage are significant independent predictors of 30-day post-ERCP mortality in patients with MBO.We should pay attention to and reasonably dispose of these independent factors to improve surgical outcomes and reduce the financial burden on the patients.
Post-ERCP complications are adverse events following surgery for MBO and may affect the short-term mortality rates of patients.Previous studies have shown that post-ERCP complications are significantly associated with short-term mortality in these patients.For instance, a retrospective study found that patients with postoperative cholangitis had significantly higher early mortality rates (6.5% vs. 0.5%, p < 0.001) [23].Another study suggested that post-ERCP complications are one of the independent risk factors for short-term mortality in patients with MBO [24].Several factors may explain why post-ERCP complications can affect short-term mortality in these patients.First, these complications can prolong hospitalization, increasing the patients burden and pain [25,26].Second, post-ERCP complications can weaken patients' physical condition, increasing the risk of short-term death [27,28].In conclusion, post-ERCP complications are closely related to short-term mortality in patients with MBO.Therefore, active measures should be taken to prevent and manage such complications during treatment, in order to reduce the risk of short-term mortality in these patients.Poor tumor staging is considered an unfavorable factor affecting the survival of patients with MBO.Due to difficulties in obtaining tumor samples and low diagnostic sensitivity, most studies [29,30] use the Bismuth-Corlette classification and metastatic status to determine tumor stages.Metastatic and advanced tumors are more likely to result in shorter survival times in patients with MBO [31].Liver metastases are an independent factor influencing the 12-month survival of patients with unresectable hilar cholangiocarcinoma (HCCA) [32].Tumor stage is an independent risk factor for survival in patients with HCCA [33].The results of the multivariable analysis in our study showed that distant metastasis was an independent adverse factor affecting survival, which is consistent with previous studies.
Furthermore, successful drainage was significantly associated with 30-day mortality.Adequate bile drainage is considered a technical success for biliary stenting and is associated with increased survival rates [22,[32][33][34][35][36][37].However, the number of stents was not associated with 30-day mortality.Several studies have reported similar effects of unilateral and bilateral stents on bile drainage  [38][39][40].In a small retrospective study of 46 consecutive patients who underwent palliative endoscopic biliary stenting for MBO, the overall stent patency rate was significantly higher in the group that received bilateral stents than that of the unilateral stenting group [41].This may be because the unilateral stent does not provide adequate drainage from the obstruction site.Stenting is performed to provide adequate drainage, and, regardless of the number of stents implanted, the final bile connection status is always the same as long as adequate drainage is ensured.Therefore, bile drainage efficiency should not be influenced by the number of stents used.
The nomogram was constructed with distant metastasis, TB, Post-ERCP complications, and successful drainage as relevant factors.Our study demonstrated that the prediction model performed well in both discriminating and calibrating the training cohort and was subsequently validated in the test cohort, showing consistent diagnostic performance and confirming its reliability.To enhance the clinical utility of the prediction model, we divided the predicted risk scores into three groups.Figure 8 depicts the reliability of this classification, which could aid physicians in deciding optimal palliative strategies for patients with unresectable MBO.For instance, patients with a total score > 120 have a high likelihood of death within 30 days of stent placement.In our scoring system, patients can reach this level even before surgery, indicating that their risk may have been underestimated.For such patients, surgery should be postponed unless it is certain that it will significantly improve the patient's symptoms.Furthermore, a preoperative multi-disciplinary treatment plan should be devised to minimize the short-term risk of death by a combination of liver protection options.If invasive interventions are performed on such patients, plastic stents may be a better choice.Patients who reach this score after stent placement should remain in hospital observation time for an appropriately extended period to prevent adverse events.In contrast, patients with probability total scores < 90 had a low probability of death 30 days after stent placement.Biliary drainage can benefit these patients, and metal stents are preferred.For patients with a total probability score between 120 and 90, the treatment approach should be determined based on the patient's performance status and the physician's discretion.
This study has multiple strengths.One of the main advantages of this study was the inclusion of a substantial cohort of patients with unresectable MBO, as well as a lengthy period of data collection.Furthermore, the study is, to our knowledge, the first to use LASSO regression to screen features and develop a 30-day mortality prediction model, which was subsequently internally validated using a test cohort.Finally, in practice, information regarding the variables used in the nomogram can be easily obtained from patients with MBO.Using our predictive model, clinicians can immediately and accurately predict a prognosis and obtain useful information regarding postoperative treatment.
However, our study also has some limitations.Firstly, being a retrospective study, we might have missed some significant clinical features associated with mortality in our cohort.Secondly, the potential for unmeasured bias cannot be ruled out, and therefore, the prediction model needs to be externally validated in a larger prospective cohort to confirm the accuracy of the model in predicting 30-day mortality after stent placement.

Conclusions
The prognosis for patients with MBO is poor.Biliary drainage can benefit these patients and, therefore, should be performed.The choice of treatment options for this group of patients should consider both cost-effectiveness and the expected length of survival.We identified four variables affecting the survival of patients with MBO and constructed a nomogram to assist clinical decisions.All the variables were objective and easily accessible.The nomogram can help identify which patients with MBO would benefit from ERCP in terms of survival.This allows us to better select future ERCP candidates and develop a reasonable treatment plan.• support for research data, including large and complex data types gold Open Access which fosters wider collaboration and increased citations maximum visibility for your research: over 100M website views per year

•
At BMC, research is always in progress.

Learn more biomedcentral.com/submissions
Ready to submit your research Ready to submit your research ?Choose BMC and benefit from: ? Choose BMC and benefit from:

Fig. 2
Fig. 2 LASSO regression variable screening (A) The variation characteristics of the coefficient of variables; B the selection process of the optimum value of the parameter λ in the LASSO regression model by cross-validation

Fig. 4
Fig. 4 Area under the curve of the risk score.A The results of 10-fold cross-validation in the training cohort; blue lines represent the average ROC curve over the 10 folds.B The 10-fold cross-validation results for the test cohort.CI, confidence interval.ROC, receiver operating characteristic

Fig. 5
Fig. 5 The calibration curve for nomogram.The nomogram-predicted short-term mortality probability is plotted on the x-axis, and the observed short-term mortality on the y-axis.A perfect prediction would correspond to a 45° grey dashed line.The blue solid line represents the cohort (training or test), and the red solid line represents the bias corrected by bootstrapping (B = 1000 repetitions), indicating the observed nomogram performance.Calibration curves for predicting short-term mortality in the training (A) and test (B) cohorts.MBO, malignant biliary obstruction

Fig. 7
Fig. 7 Schoenfeld residuals analysis of risk groups.A Hazard ratio in different risk groups.B L, low-risk group.M, moderate-risk group.H high-risk group.95%CI, 95% confidence interval

•
thorough peer review by experienced researchers in your field • rapid publication on acceptance

Table 1
Baseline characteristics comparison between groups Defined by a decrease in TB > 30% within 1 week after surgery or a decrease in TB close to the normal level (TB ≤ 17.1umol/l) in the later period ERCP Endoscopic retrograde cholangiopancreatography, TB Total bilirubin, ALT Alanine aminotransferase, AST Aspartate aminotransferase, PT Prothrombin time Statistically significant with p < 0.05 a Interquartile range b

Red blood cell count (10 12 /L), Mean ± SD
Table2 Patient characteristics and endoscopic interventions in the training and validation cohorts

Red blood cell count (10 12 /L), Mean ± SD
ERCP Endoscopic retrograde cholangiopancreatography, TB Total bilirubin, ALT alanine aminotransferase, AST Aspartate aminotransferase, PT Prothrombin time Statistically significant with p < 0.05 a Interquartile range b Defined by a decrease in TB of > 30% within 1 week after surgery or a decrease in TB close to the normal level (TB ≤ 17.1umol/l) in the later period c Defined by death within 30 days of ERCP

Table 3
Univariate and multivariate analyses of baseline variables for 30-day mortality prediction in the training cohort ERCP Endoscopic retrograde cholangiopancreatography, TB Total bilirubin, ALT alanine aminotransferase, AST Aspartate aminotransferase, PT Prothrombin time, OR Odds ratio, CI Confidence interval Statistically significant with p < 0.05 a Defined by a decrease in TB of > 30% within 1 week after surgery or a decrease in TB close to the normal level (TB ≤ 17.1umol/l) in the later period