Survival Prediction Model for Patients with Hepatocellular Carcinoma and Extrahepatic Metastasis Based on XGBoost Algorithm Authors: Jihye Lim, Hyeon-Gi Jeon, Yeonjoo Seo, Moonjin Kim, Ja Un Moon, Se Hyun Cho Published: 2023 ABSTRACT PurposeAccurate estimation of survival is of utmost importance in patients with hepatocellular carcinoma (HCC) and extrahepatic metastasis. This study aimed to develop a survival prediction model using real-world data.Patients and MethodsA total of 993 patients with treatment-naïve HCC and extrahepatic metastasis were included from 13 Korean hospitals between 2013 and 2018. Patients were randomly divided into a training set (70.0%) and a test set (30.0%). The eXtreme Gradient Boosting (XGBoost) algorithm was applied to predict survival at 3, 6, and 12 months.ResultsThe mean age of the patients was 60.8 ± 12.3 years, and 85.4% were male. During the study period, 96.1% died, and median survival duration was 4.0 months. In multivariate analysis, Child-Pugh class, number and size of tumors, presence of vascular or bile duct invasion, lung or bone metastasis, serum AFP, and primary anti-HCC treatment were associated with survival. We constructed a model for survival prediction based on the relevant variables, which is available online (https://metastatic-hcc.onrender.com/form). Our model demonstrated high performance, with areas under the receiver operating characteristic curves of 0.778, 0.794, and 0.784 at 3, 6, and 12 months, respectively. Feature importance analysis indicated that the primary anti-HCC treatment had the highest importance.ConclusionWe developed a model to predict the survival of patients with HCC and extrahepatic metastasis, which demonstrated good discriminative ability. Our model would be helpful for personalized treatment and for improving the prognosis. Introduction Hepatocellular carcinoma (HCC) is a multifaceted disease that requires careful consideration of treatment decisions. Unlike other solid cancers which are mostly treated according to the tumor burden, HCC treatment requires careful evaluation of concomitant liver disease, liver function, and general performance status as well as intra- and extrahepatic tumor burden.1–4 Also, HCCs have inter-patient and intra-tumoral heterogeneity arising from chronic liver inflammation with complex pathogenesis, accompanied by a range of genetic and epigenetic changes.5 Thereby, patients with HCC and extrahepatic metastasis, classified under the same stage, may exhibit varied clinical courses with estimated survival duration of 7–16 months.2,4,6 However, survival prediction of patients with HCC and extrahepatic metastasis often relies on a few studies analyzed with a limited set of factors, or on physicians’ experience, which is prone to inaccurate. Hence, there has been an urgent need for systematic and personalized survival prediction for these patients. The eXtreme Gradient Boosting (XGBoost) algorithm, a product of modern information technology, was introduced by Chen and Guestrin in 2016.7 This algorithm employs ensemble learning, one of the most widely used machine learning methods, to construct a single generalized model with high predictive ability. It leverages the gradient descent method to generate decision trees for classification and regression, thereby enhancing robustness.8 XGBoost is renowned for improving the accuracy and computational speed of machine learning algorithms, and has found widespread applications in various fields, including the medical domain.7–10 Another strength of XGBoost is its interpretability. The decision-making process of XGBoost is understandable, unlike other machine learning algorithms.11,12 Utilizing XGBoost in the context of patients with HCC and extrahepatic metastasis can enhance survival prediction performance. This study aimed to develop a model for predicting the survival of patients with HCC and extrahepatic metastasis using the XGBoost algorithm with risk factors associated with survival. Materials and Methods Study Design and Population Between January 2013 and December 2018, 9083 patients initially diagnosed with HCC and extrahepatic metastasis were recruited from the National Cancer Registry in Korea. The National Cancer Center selected 13 hospitals, of which over 75% of patients with liver cancer in Korea were treated to build the registry. A systematic extraction method was used to sample 10% of the initially diagnosed HCC patients, and their comprehensive medical data were investigated by medical record administrators. Death status and date of death were obtained from the Korean Statistical Office. The diagnosis of HCC was based on radiological hallmarks in multiphasic CT or MRI, arterial phase enhancement, and portal or delayed phase washout appearance, according to the KLCA-NCC Korea practice guidelines.2 Of these patients, we excluded the following:1) 255 patients with missing data; 2) 243 patients who died within 30 days after initial HCC diagnosis; 3) 8585 patients without extrahepatic metastasis. The 993 patients were finally enrolled (Figure 1). This study was approved by the Institutional Review Board (IRB) of Catholic Medical Center (IRB No. SC22ZISE0092), and the need for informed consent was waived owing to the use of de-identified data. It was conducted in accordance with the Declaration of Helsinki and Istanbul. Figure 1Study flow. Study flow. Data Collection We gathered data on various clinical variables at the time of initial HCC diagnosis that are known to impact prognosis:1) baseline patient-related variables including age, sex, body mass index (BMI), alcohol consumption, smoking, presence of diabetes, hypertension, dyslipidemia, and Eastern Cooperative Oncology Group (ECOG) performance status; 2) liver-related variables obtained for the etiology of liver disease, Child-Pugh class, Model for End-stage Liver Disease (MELD) score, and cirrhosis by image or fibrosis-4 (FIB-4) index ≥ 2.67;13 3) laboratory findings including platelet, prothrombin time, aspartic acid transaminase (AST), alanine transaminase (ALT), albumin, total bilirubin, creatinine, sodium, glucose, and total cholesterol; 4) tumor-related factors including number of tumors, size of the tumor, presence of intrahepatic vascular or bile duct invasion, extrahepatic metastatic site classified as regional lymph node, lung, bone, distal lymph node and others, alpha-fetoprotein (AFP), and initial anti-HCC treatment. Outcomes The primary outcome of this study was to identify the clinical factors that affect survival and to estimate the survival of patients with HCC and extrahepatic metastasis at 3, 6, and 12 months after the initial diagnosis. In addition, we sought to develop a personalized model that could accurately predict survival. Statistical Analysis and Construction of a Prediction Model Categorical variables were expressed as numbers with percentages and analyzed using the chi-square or Fisher’s exact test. Continuous variables were summarized as mean ± standard deviation (SD) and analyzed using the t-test or Mann–Whitney U-test. Survival along with clinical variables were estimated and compared with the Kaplan-Meier and Log rank test. Traditional Cox proportional hazard models were used to identify factors that could significantly influence survival. The hazard ratios (HR) and 95% confidence intervals (CI) were summarized. Statistical significance was set at P < 0.05. In addition, we used XGBoost, a gradient-boosted decision tree algorithm, to build a prediction model with complete case analysis. We utilized multiple imputations to estimate missing data with less than 10% of patients who did not introduce bias.14 Variables with more than 10% of missing data were excluded for model development. The data was randomly split into a training set and a test set in a 7:3 ratio. The training set was used for model training, and the test set was employed for validation to assess the model’s accuracy. We selected variables that demonstrated statistical significance in multivariable analysis or clinical relevance to include in the model. The response variables, representing survival information at each time point, were obtained. To build our prediction models, we used the following parameters: number of estimators = 300, maximum depth of each tree = 15, colsample.bytree = 0.75, and gamma = 3.87. We utilized ensemble learning methods such as Bootstrap Aggregating and Boosting to integrate decision trees, effectively reducing both bias-related and variance-related errors.15 The results generated by XGBoost ranged between 0 and 1, representing the probability of survival. Patients with results greater than 0.5 were classified as dead, while those with results less than 0.5 were classified as alive. The performance of model was assessed by evaluating its accuracy, precision (positive predictive value), recall (sensitivity), F1 score (harmonic mean of precision and recall), and area under the receiver operating characteristic curve (AUC). An AUC value greater than 0.5 is considered statistically significant in evaluating binary classifiers.16 Additionally, we analyzed the feature importance and decision trees of each model to elucidate and understand the decision-making process Finally, we utilized a web-hosting service named “Render” to upload our model and make it available on a website for broader accessibility.17 All statistical analyses were performed with R software version 4.1.3, SAS version 9.4 (SAS Institute, Inc., Cary, NC, USA), and Python 3.9.16 (Python Software Foundation, Delaware, USA). Results Characteristics of the Study Population Of the 993 patients, 695 (70.0%) and 298 (30.0%) were assigned to the training and test sets, respectively. The baseline characteristics of the two groups are shown in Table 1. The mean (± SD) age was 60.8 (± 12.3) years. Males accounted for 85.4% and hepatitis B virus (HBV) infection was the most common cause of HCC (60.1%). Among the study participants, 56.1% had Child-Pugh class A liver function, 48.7% had more than five masses, and 48.9% had the tumors larger than 10 cm in diameter. Intrahepatic vascular or bile duct invasion was observed in 63.3% of the patients. Regional lymph nodes were the most frequent metastatic sites (51.5%), followed by the lungs (39.8%), distant lymph nodes (21.1%), bones (20.0%), and others (17.9%). The mean AFP was 44,108.7 ± 212,265.8 ng/dL. Supportive care (36.8%) was the most common first-line treatment, followed by systemic chemotherapy (28.8%), and transarterial therapy (24.8%). There was no statistically significant difference in the baseline characteristics between the two datasets.Table 1Baseline Characteristics of the Study PopulationTotalTrain setTest setP-value(N=993)(N=695)(N=298)Patients-related factorsAge, years60.8 ± 12.360.4 ± 12.561.6 ± 11.60.185Male sex, n (%)848 (85.4%)587 (84.5%)261 (87.6%)0.238Alcohol418 (42.1%)281 (40.4%)137 (46.0%)0.121Smoking516 (52.0%)362 (52.1%)154 (51.7%)0.961Diabetes262 (26.4%)177 (25.5%)85 (28.5%)0.356Hypertension324 (32.6%)226 (32.5%)98 (32.9%)0.969Dyslipidemia722 (72.7%)506 (72.8%)216 (72.5%)0.207Body mass index, kg/m223.2 ± 3.523.2 ± 3.523.0 ± 3.70.407ECOG performance status0.918 0337 (33.9%)241 (34.7%)96 (32.2%) 1240 (24.2%)165 (23.7%)75 (25.2%) 260 (6.0%)41 (5.9%)19 (6.4%) 327 (2.7%)19 (2.7%)8 (2.7%) 415 (1.5%)12 (1.7%)3 (1.0%) Missing314 (31.6%)217 (31.2%)97 (32.6%)Liver-related factorsEtiology of liver disease0.080 HBV infection597 (60.1%)424 (61.0%)173 (58.1%) HCV infection77 (7.8%)48 (6.9%)29 (9.7%) Alcohol148 (14.9%)95 (13.7%)53 (17.8%) Others171 (17.2%)128 (18.4%)43 (14.4%)Child-Pugh class0.161 A557 (56.1%)382 (55.0%)175 (58.7%) B367 (37.0%)258 (37.1%)109 (36.6%) C69 (6.9%)55 (7.9%)14 (4.7%)MELD score8.2 ± 1.88.3 ± 1.98.1 ± 1.60.152Cirrhosis0.313 Without cirrhosis146 (14.7%)101 (14.5%)45 (15.1%) With cirrhosis300 (30.2%)220 (31.7%)80 (26.8%) Missing547 (55.1%)374 (53.8%)173 (58.1%)Laboratory findingsPlatelets, 1000/mm3206.0 ± 110.5208.8 ± 118.1199.4 ± 90.00.171Prothrombin time, INR1.2 ± 0.31.2 ± 0.31.2 ± 0.20.113AST, IU/L123.6 ± 118.5126.3 ± 122.6116.9 ± 107.70.345ALT, IU/L61.6 ± 57.062.5 ± 55.659.6 ± 60.40.475Albumin, g/dL3.5 ± 0.63.5 ± 0.63.6 ± 0.70.234Total bilirubin, mg/dL2.1 ± 3.52.1 ± 3.61.9 ± 3.40.280Creatinine, mg/dL0.9 ± 0.61.0 ± 0.70.9 ± 0.40.375Sodium, mmol/L136.4 ± 4.4136.4 ± 4.2136.4 ± 4.70.897Glucose, mg/dL131.1 ± 62.2130.6 ± 61.5132.4 ± 63.70.724Total cholesterol, mg/dL171.2 ± 66.7171.4 ± 66.1170.9 ± 68.00.924Tumor-related factorsNumber of tumors0.102 1386 (38.9%)258 (37.1%)128 (43.0%) 287 (8.8%)55 (7.9%)32 (10.7%) 326 (2.6%)17 (2.4%)9 (3.0%) 410 (1.0%)8 (1.2%)2 (0.7%) ≥5484 (48.7%)357 (51.4%)127 (42.6%)Size of tumor, cm0.472 ≤ 248 (4.8%)37 (5.3%)11 (3.7%) 2–5134 (13.5%)89 (12.8%)45 (15.1%) 5–7117 (11.8%)78 (11.2%)39 (13.1%) 7–10208 (20.9%)152 (21.9%)56 (18.8%) > 10486 (48.9%)339 (48.8%)147 (49.3%)Vascular or bile duct invasion629 (63.3%)444 (63.9%)185 (62.1%)0.639Extrahepatic involvement Regional lymph node511 (51.5%)354 (50.9%)157 (52.7%)0.663 Lung395 (39.8%)280 (40.3%)115 (38.6%)0.667 Bone199 (20.0%)138 (19.9%)61 (20.5%)0.893 Distant lymph node210 (21.1%)147 (21.2%)63 (21.1%)>0.999 Others178 (17.9%)124 (17.8%)54 (18.1%)0.988AFP, ng/dL44108.7 ± 212,265.841,953.1 ± 204,184.449,136.1 ± 230,296.40.642Primary anti-HCC treatment0.072 Surgical resection42 (4.2%)24 (3.5%)18 (6.0%) Liver transplantation3 (0.3%)2 (0.3%)1 (0.3%) Local ablation therapy7 (0.7%)3 (0.4%)4 (1.3%) Transarterial therapy246 (24.8%)163 (23.5%)83 (27.9%) Chemotherapy286 (28.8%)202 (29.1%)84 (28.2%) Radiation therapy44 (4.4%)36 (5.2%)8 (2.7%) Supportive care365 (36.8%)265 (38.1%)100 (33.6%)Notes: Values are expressed as the mean ± standard deviation or frequency (percentage).Abbreviations: AFP, alpha-fetoprotein; ALT, alanine aminotransferase; AST, aspartate aminotransferase; ECOG, Eastern Cooperative Oncology Group; HBV, hepatitis B virus; HCV, hepatitis C virus; INR, international normalized ratio; MELD, model for end-stage liver disease. Table 1Baseline Characteristics of the Study PopulationTotalTrain setTest setP-value(N=993)(N=695)(N=298)Patients-related factorsAge, years60.8 ± 12.360.4 ± 12.561.6 ± 11.60.185Male sex, n (%)848 (85.4%)587 (84.5%)261 (87.6%)0.238Alcohol418 (42.1%)281 (40.4%)137 (46.0%)0.121Smoking516 (52.0%)362 (52.1%)154 (51.7%)0.961Diabetes262 (26.4%)177 (25.5%)85 (28.5%)0.356Hypertension324 (32.6%)226 (32.5%)98 (32.9%)0.969Dyslipidemia722 (72.7%)506 (72.8%)216 (72.5%)0.207Body mass index, kg/m223.2 ± 3.523.2 ± 3.523.0 ± 3.70.407ECOG performance status0.918 0337 (33.9%)241 (34.7%)96 (32.2%) 1240 (24.2%)165 (23.7%)75 (25.2%) 260 (6.0%)41 (5.9%)19 (6.4%) 327 (2.7%)19 (2.7%)8 (2.7%) 415 (1.5%)12 (1.7%)3 (1.0%) Missing314 (31.6%)217 (31.2%)97 (32.6%)Liver-related factorsEtiology of liver disease0.080 HBV infection597 (60.1%)424 (61.0%)173 (58.1%) HCV infection77 (7.8%)48 (6.9%)29 (9.7%) Alcohol148 (14.9%)95 (13.7%)53 (17.8%) Others171 (17.2%)128 (18.4%)43 (14.4%)Child-Pugh class0.161 A557 (56.1%)382 (55.0%)175 (58.7%) B367 (37.0%)258 (37.1%)109 (36.6%) C69 (6.9%)55 (7.9%)14 (4.7%)MELD score8.2 ± 1.88.3 ± 1.98.1 ± 1.60.152Cirrhosis0.313 Without cirrhosis146 (14.7%)101 (14.5%)45 (15.1%) With cirrhosis300 (30.2%)220 (31.7%)80 (26.8%) Missing547 (55.1%)374 (53.8%)173 (58.1%)Laboratory findingsPlatelets, 1000/mm3206.0 ± 110.5208.8 ± 118.1199.4 ± 90.00.171Prothrombin time, INR1.2 ± 0.31.2 ± 0.31.2 ± 0.20.113AST, IU/L123.6 ± 118.5126.3 ± 122.6116.9 ± 107.70.345ALT, IU/L61.6 ± 57.062.5 ± 55.659.6 ± 60.40.475Albumin, g/dL3.5 ± 0.63.5 ± 0.63.6 ± 0.70.234Total bilirubin, mg/dL2.1 ± 3.52.1 ± 3.61.9 ± 3.40.280Creatinine, mg/dL0.9 ± 0.61.0 ± 0.70.9 ± 0.40.375Sodium, mmol/L136.4 ± 4.4136.4 ± 4.2136.4 ± 4.70.897Glucose, mg/dL131.1 ± 62.2130.6 ± 61.5132.4 ± 63.70.724Total cholesterol, mg/dL171.2 ± 66.7171.4 ± 66.1170.9 ± 68.00.924Tumor-related factorsNumber of tumors0.102 1386 (38.9%)258 (37.1%)128 (43.0%) 287 (8.8%)55 (7.9%)32 (10.7%) 326 (2.6%)17 (2.4%)9 (3.0%) 410 (1.0%)8 (1.2%)2 (0.7%) ≥5484 (48.7%)357 (51.4%)127 (42.6%)Size of tumor, cm0.472 ≤ 248 (4.8%)37 (5.3%)11 (3.7%) 2–5134 (13.5%)89 (12.8%)45 (15.1%) 5–7117 (11.8%)78 (11.2%)39 (13.1%) 7–10208 (20.9%)152 (21.9%)56 (18.8%) > 10486 (48.9%)339 (48.8%)147 (49.3%)Vascular or bile duct invasion629 (63.3%)444 (63.9%)185 (62.1%)0.639Extrahepatic involvement Regional lymph node511 (51.5%)354 (50.9%)157 (52.7%)0.663 Lung395 (39.8%)280 (40.3%)115 (38.6%)0.667 Bone199 (20.0%)138 (19.9%)61 (20.5%)0.893 Distant lymph node210 (21.1%)147 (21.2%)63 (21.1%)>0.999 Others178 (17.9%)124 (17.8%)54 (18.1%)0.988AFP, ng/dL44108.7 ± 212,265.841,953.1 ± 204,184.449,136.1 ± 230,296.40.642Primary anti-HCC treatment0.072 Surgical resection42 (4.2%)24 (3.5%)18 (6.0%) Liver transplantation3 (0.3%)2 (0.3%)1 (0.3%) Local ablation therapy7 (0.7%)3 (0.4%)4 (1.3%) Transarterial therapy246 (24.8%)163 (23.5%)83 (27.9%) Chemotherapy286 (28.8%)202 (29.1%)84 (28.2%) Radiation therapy44 (4.4%)36 (5.2%)8 (2.7%) Supportive care365 (36.8%)265 (38.1%)100 (33.6%)Notes: Values are expressed as the mean ± standard deviation or frequency (percentage).Abbreviations: AFP, alpha-fetoprotein; ALT, alanine aminotransferase; AST, aspartate aminotransferase; ECOG, Eastern Cooperative Oncology Group; HBV, hepatitis B virus; HCV, hepatitis C virus; INR, international normalized ratio; MELD, model for end-stage liver disease. Baseline Characteristics of the Study Population Notes: Values are expressed as the mean ± standard deviation or frequency (percentage). Abbreviations: AFP, alpha-fetoprotein; ALT, alanine aminotransferase; AST, aspartate aminotransferase; ECOG, Eastern Cooperative Oncology Group; HBV, hepatitis B virus; HCV, hepatitis C virus; INR, international normalized ratio; MELD, model for end-stage liver disease. Survival Analysis and Risk Factors Associated with Mortality During a median follow-up of 4.0 months (range, 2.00–9.02 months), 96.1% of the patients died in our study cohort. Survival rates were 62.5%, 38.6%, 26.8%, 21.7%, and 17.8% at 3, 6, 9, 12, and 15 months, respectively. In a multivariate analysis, Child-Pugh class (class B: HR, 1.52 [95% CI, 1.31–1.77], P < 0.001; class C: HR, 1.60 [95% CI, 1.18–2.17], P = 0.003), platelets, log10 1000/mm3 (HR, 1.55 [95% CI, 1.14–2.11], P = 0.005), sodium, mmol/L (HR, 0.97 [95% CI, 0.95–0.99], P < 0.001), number of tumors (≥ 5: HR, 1.35 [95% CI, 1.17–1.56], P < 0.001), size of tumors (5–7 cm: HR, 1.48 [95% CI, 1.01–2.17], P = 0.046; 7–10 cm: HR, 1.64 [95% CI, 1.14–2.35], P = 0.008; > 10 cm: HR, 1.71 [95% CI, 1.2–2.45], P = 0.003), presence of vascular or bile duct invasion (HR, 1.17 [95% CI, 1.01–1.36], P= 0.035), lung metastasis (HR, 1.19 [95% CI, 1.01–1.39], P = 0.032), bone metastasis (HR, 1.36 [95% CI, 1.14–1.62], P = 0.001), serum AFP, log10 ng/dL (HR, 1.08 [95% CI, 1.03–1.14], P = 0.001), and primary anti-HCC treatment other than supportive care (surgical resection: HR 0.24 [95% CI, 0.16–0.35], P < 0.001; liver transplantation: HR, 0.28 [95% CI, 0.09–0.89], P = 0.031; local ablation therapy: HR, 0.35 [95% CI, 0.14–0.87], P = 0.024; transarterial therapy: HR, 0.46 [95% CI, 0.39–0.56], P < 0.001; chemotherapy: HR, 0.67 [95% CI, 0.57–0.8], P < 0.001; radiation therapy: HR, 0.61 [95% CI, 0.44–0.84], P = 0.003) were associated with mortality (Table 2 and Supplementary Figure 1).Table 2Univariate and Multivariate Analyses for Overall SurvivalUnivariate AnalysisP-valueMultivariate AnalysisP-valueHR (95% CI)HR (95% CI)Patients-related factorsAge, years1.00 (1.00–1.01)0.335Male sex, n (%)1.11 (0.93–1.33)0.265Alcohol0.88 (0.77–1.00)0.054Smoking1.01 (0.89–1.15)0.858Diabetes0.98 (0.85–1.13)0.742Hypertension1.00 (0.87–1.15)0.995Dyslipidemia1.00 (1.00–1.00)0.128Body mass index, kg/m20.98 (0.96–1.00)0.0431.00 (0.98–1.02)0.935Liver-related factorsEtiology of liver disease HBV infection1 (reference) HCV infection1.11 (0.87–1.41)0.411 Alcohol0.83 (0.69–1.00)0.054 Others1.06 (0.89–1.26)0.49Child-Pugh class A1 (reference) B1.72 (1.50–1.97)< 0.0011.52 (1.31–1.77)< 0.001 C2.64 (2.04–3.40)< 0.0011.60 (1.18–2.17)0.003Laboratory findingsPlatelets, log10 1000/mm31.58 (1.18–2.11)0.0021.55 (1.14–2.11)0.005ALT, log10 IU/L1.39 (1.15–1.68)0.0010.93 (0.76–1.13)0.450Creatinine, mg/dL1.06 (0.95–1.17)0.297Sodium, mmol/L0.94 (0.93–0.95)< 0.0010.97 (0.95–0.99)< 0.001Tumor-related factorsNumber of tumors 11 (reference)1 (reference) 21.10 (0.86–1.39)0.4551.12 (0.88–1.44)0.356 30.75 (0.50–1.14)0.1831.14 (0.74–1.75)0.545 40.80 (0.43–1.51)0.4940.78 (0.41–1.48)0.445 ≥51.62 (1.41–1.86)< 0.0011.35 (1.17–1.56)< 0.001Size of tumor, cm ≤ 21 (reference)1 (reference) 2–51.55 (1.09–2.21)0.0151.25 (0.87–1.81)0.226 5–71.89 (1.32–2.71)0.0011.48 (1.01–2.17)0.046 7–102.23 (1.59–3.13)< 0.0011.64 (1.14–2.35)0.008 > 102.89 (2.10–3.99)< 0.0011.71 (1.20–2.45)0.003Vascular or bile duct invasion1.49 (1.31–1.70)< 0.0011.17 (1.01–1.36)0.035Extrahepatic involvement Regional lymph node0.92 (0.81–1.05)0.2151.12 (0.97–1.30)0.130 Lung1.53 (1.34–1.74)< 0.0011.19 (1.01–1.39)0.032 Bone1.14 (0.98–1.34)0.0961.36 (1.14–1.62)0.001 Distant lymph node1.22 (1.05–1.43)0.0121.06 (0.90–1.25)0.468 Others1.19 (1.01–1.40)0.0411.04 (0.88–1.24)0.639AFP, log10 ng/dL1.16 (1.11–1.21)< 0.0011.08 (1.03–1.14)0.001Primary anti-HCC treatment Supportive care1 (reference)1 (reference) Surgical resection0.18 (0.12–0.26)< 0.0010.24 (0.16–0.35)< 0.001 Liver transplantation0.45 (0.14–1.40)0.1660.28 (0.09–0.89)0.031 Local ablation therapy0.15 (0.06–0.36)< 0.0010.35 (0.14–0.87)0.024 Transarterial therapy0.38 (0.32–0.45)< 0.0010.46 (0.39–0.56)< 0.001 Chemotherapy0.72 (0.61–0.84)< 0.0010.67 (0.57–0.80)< 0.001 Radiation therapy0.69 (0.51–0.95)0.0210.61 (0.44–0.84)0.003Abbreviations: AFP, alpha-fetoprotein; ALT, alanine aminotransferase; CI, confidence interval; HBV, hepatitis B virus; HCV, hepatitis C virus; HR, hazard ratio. Table 2Univariate and Multivariate Analyses for Overall SurvivalUnivariate AnalysisP-valueMultivariate AnalysisP-valueHR (95% CI)HR (95% CI)Patients-related factorsAge, years1.00 (1.00–1.01)0.335Male sex, n (%)1.11 (0.93–1.33)0.265Alcohol0.88 (0.77–1.00)0.054Smoking1.01 (0.89–1.15)0.858Diabetes0.98 (0.85–1.13)0.742Hypertension1.00 (0.87–1.15)0.995Dyslipidemia1.00 (1.00–1.00)0.128Body mass index, kg/m20.98 (0.96–1.00)0.0431.00 (0.98–1.02)0.935Liver-related factorsEtiology of liver disease HBV infection1 (reference) HCV infection1.11 (0.87–1.41)0.411 Alcohol0.83 (0.69–1.00)0.054 Others1.06 (0.89–1.26)0.49Child-Pugh class A1 (reference) B1.72 (1.50–1.97)< 0.0011.52 (1.31–1.77)< 0.001 C2.64 (2.04–3.40)< 0.0011.60 (1.18–2.17)0.003Laboratory findingsPlatelets, log10 1000/mm31.58 (1.18–2.11)0.0021.55 (1.14–2.11)0.005ALT, log10 IU/L1.39 (1.15–1.68)0.0010.93 (0.76–1.13)0.450Creatinine, mg/dL1.06 (0.95–1.17)0.297Sodium, mmol/L0.94 (0.93–0.95)< 0.0010.97 (0.95–0.99)< 0.001Tumor-related factorsNumber of tumors 11 (reference)1 (reference) 21.10 (0.86–1.39)0.4551.12 (0.88–1.44)0.356 30.75 (0.50–1.14)0.1831.14 (0.74–1.75)0.545 40.80 (0.43–1.51)0.4940.78 (0.41–1.48)0.445 ≥51.62 (1.41–1.86)< 0.0011.35 (1.17–1.56)< 0.001Size of tumor, cm ≤ 21 (reference)1 (reference) 2–51.55 (1.09–2.21)0.0151.25 (0.87–1.81)0.226 5–71.89 (1.32–2.71)0.0011.48 (1.01–2.17)0.046 7–102.23 (1.59–3.13)< 0.0011.64 (1.14–2.35)0.008 > 102.89 (2.10–3.99)< 0.0011.71 (1.20–2.45)0.003Vascular or bile duct invasion1.49 (1.31–1.70)< 0.0011.17 (1.01–1.36)0.035Extrahepatic involvement Regional lymph node0.92 (0.81–1.05)0.2151.12 (0.97–1.30)0.130 Lung1.53 (1.34–1.74)< 0.0011.19 (1.01–1.39)0.032 Bone1.14 (0.98–1.34)0.0961.36 (1.14–1.62)0.001 Distant lymph node1.22 (1.05–1.43)0.0121.06 (0.90–1.25)0.468 Others1.19 (1.01–1.40)0.0411.04 (0.88–1.24)0.639AFP, log10 ng/dL1.16 (1.11–1.21)< 0.0011.08 (1.03–1.14)0.001Primary anti-HCC treatment Supportive care1 (reference)1 (reference) Surgical resection0.18 (0.12–0.26)< 0.0010.24 (0.16–0.35)< 0.001 Liver transplantation0.45 (0.14–1.40)0.1660.28 (0.09–0.89)0.031 Local ablation therapy0.15 (0.06–0.36)< 0.0010.35 (0.14–0.87)0.024 Transarterial therapy0.38 (0.32–0.45)< 0.0010.46 (0.39–0.56)< 0.001 Chemotherapy0.72 (0.61–0.84)< 0.0010.67 (0.57–0.80)< 0.001 Radiation therapy0.69 (0.51–0.95)0.0210.61 (0.44–0.84)0.003Abbreviations: AFP, alpha-fetoprotein; ALT, alanine aminotransferase; CI, confidence interval; HBV, hepatitis B virus; HCV, hepatitis C virus; HR, hazard ratio. Univariate and Multivariate Analyses for Overall Survival Abbreviations: AFP, alpha-fetoprotein; ALT, alanine aminotransferase; CI, confidence interval; HBV, hepatitis B virus; HCV, hepatitis C virus; HR, hazard ratio. Model Construction and Evaluation Based on survival analysis, the following variables were included to build a model: age, sex, BMI, etiology of liver disease, Child-Pugh class, platelet count, ALT level, sodium level, number of tumors, tumor size, presence of vascular or bile duct invasion, metastatic site, serum AFP level, and primary treatment method for HCCs. We built survival prediction model for 3, 6, and 12-months by using the training dataset. The performances of these models are summarized in Table 3. Figure 2 shows AUC of each model. The AUC values of the test set at 3, 6, and 12-months were 0.778, 0.794, and 0.784, respectively, demonstrating the discriminative ability. We then created decision trees. A schematic representation of the decision tree of each model is presented in Supplementary Figure 2. Using the XGBoost model, we identified the feature importance for 3-, 6-, and 12-months survival based on the magnitude of the gain value obtained for each variable. As shown in Figure 3, the primary anti-HCC treatment was a discriminative feature for predicting survival.Table 3Performance Metrics of 3-, 6-, and 12-Months Survival Prediction ModelsAccuracyPrecisionRecallF1 scoreAUC3-months Train set0.8490.8400.7060.7670.925 Test set0.7350.6540.4950.5640.7786-months Train set0.8460.8430.9320.8850.910 Test set0.7150.7100.8320.7560.79412-months Train set0.9080.9160.9430.9440.941 Test set0.7920.8330.9010.8690.784Abbreviation: AUC, area under the receiver operating characteristic curve. Figure 2Logistic regression analysis in the test cohort. Area under the receiver operating characteristic curve for (A) 3-, (B) 6-, and (C) 12- months. Figure 3Feature importance of (A) 3-, (B) 6-, and (C) 12- months survival prediction model in hepatocellular carcinoma patients with extrahepatic metastasis. Table 3Performance Metrics of 3-, 6-, and 12-Months Survival Prediction ModelsAccuracyPrecisionRecallF1 scoreAUC3-months Train set0.8490.8400.7060.7670.925 Test set0.7350.6540.4950.5640.7786-months Train set0.8460.8430.9320.8850.910 Test set0.7150.7100.8320.7560.79412-months Train set0.9080.9160.9430.9440.941 Test set0.7920.8330.9010.8690.784Abbreviation: AUC, area under the receiver operating characteristic curve. Performance Metrics of 3-, 6-, and 12-Months Survival Prediction Models Abbreviation: AUC, area under the receiver operating characteristic curve. Logistic regression analysis in the test cohort. Area under the receiver operating characteristic curve for (A) 3-, (B) 6-, and (C) 12- months. Feature importance of (A) 3-, (B) 6-, and (C) 12- months survival prediction model in hepatocellular carcinoma patients with extrahepatic metastasis. Model Application Our prediction model is available online (https://metastatic-hcc.onrender.com/form). For example, a male patient aged 50 years with HBV-induced, single, and 8.4 cm sized HCC with bone metastasis was part of our cohort. At the time of diagnosis, his BMI was 21.2 kg/m2, he had Child-Pugh class A, ALT of 25 IU/L, platelet count of 211x103/mm3, sodium of 142 mmol/L, and AFP level of 16,600 ng/dL. The patient then underwent transarterial therapy. According to our model, the patient survival probabilities at 3, 6, and 12 months were 95.0%, 65.3%, and 17.9%, respectively (Figure 4). He died 9.0 months after the initial HCC diagnosis. Figure 4An example of applying our model to estimate survival probability at 3 months. An example of applying our model to estimate survival probability at 3 months. Discussion We developed a survival prediction model using XGBoost for patients with HCC and extrahepatic metastasis. We utilized a large volume of qualified data from multi-centers and used variables commonly evaluated in real-world practice. Our model achieved AUC values of 0.778, 0.794, and 0.784 for the 3-, 6-, and 12-month survival probabilities, respectively. Using our model, patients with HCC and extrahepatic metastasis can obtain more detailed information about their prognosis and enable individualized treatment. Being diagnosed with advanced cancer brings anxiety and uncertainty with the anticipation of suffering and fear of death.18,19 The patients want to participate in their care process with necessary information for the best decisions. They hope to be prepared for their death making certain arrangements beforehand. The caregivers are also forced to face emotional and practical hardships.20 They feel anxiety and depression affecting mental health before and after the patient’s death. The financial burden caused by medical care and loss of productivity often overwhelms their financial condition. Therefore, the reliable anticipation of life expectancy is crucial for patients and their loved ones. Despite active surveillance, about 12–18% of patients with HCC are diagnosed with extrahepatic metastasis.21–24 In our study, 11.6% of patients with HCC had extrahepatic metastasis. The frequency of metastatic sites differs according to the studies. A Japanese study including 151 patients with metastatic HCC reported that the lung (47.0%), regional lymph node (42.4%), and bone (37.1%) were frequent sites for HCC metastasis at 2007.23 Another study conducted in the USA in 2014 using claims data revealed that the lung (30.8%), peritoneum (19.0%), bone (15.9%), and lymph nodes below the diaphragm (11.2%) were the common sites of HCC.21 We found that metastasis to lung and bone had a negative effect on survival. In a European study, it was observed that the presence of lung metastasis reduced survival, whereas bone metastasis did not have a similar effect.25 The association between metastatic site and survival is an intriguing finding, which could be attributed to distinct metastatic mechanisms. Lung metastasis is commonly associated with hematogenous spread through encapsulating tumor clusters and macro trabecular-massive subtypes.26–28 It is expected to facilitate tumor spread through blood circulation. Whereas, lymph node metastasis occurs through increased lymphangiogenesis of the tumor along with epithelial–mesenchymal transition.29 The metastatic lymph node has high immune cell infiltration with more fibrous tumor stroma than the lung reflecting immune system activation against HCC.30 Lastly, bone metastasis has both hematogenous and lymphatic spread features.28 In our study, liver function and tumor burden played a critical role in prognosis consistent with previous studies.23,31,32 In particular, various anti-HCC treatment strategies resulted in positive responses. Intrahepatic HCC-directed therapies such as surgery, local ablation therapy, transarterial therapy, and radiation therapy have improved survival and are recommended for patients with HCC and extrahepatic metastasis.2,3,32–36 A Korean study reported that 13.1% of the patients with HCC and extrahepatic metastasis, who were treated with multimodal strategies obtained objective intrahepatic tumor response and gained improved survival compared with their counterparts.32 We employed the XGBoost algorithm for survival prediction and model development by leveraging a large patient dataset. XGBoost is a powerful machine learning algorithm that can handle high-dimensional data while reducing the risk of overfitting by automatically selecting and utilizing important factors.7 Moreover, it utilizes ensemble learning techniques, which enables decision trees to improve performance and reduce learning time.7 XGBoost also provides feature importance and a decision tree that enhances interpretability compared to previous machine learning algorithms.37 There are several limitations in our study. First, the median survival of our patients was only 4.0 months, which is relatively shorter than that reported in previous studies.2 This shorter survival time may be attributed to the inclusion of heterogeneous patients, especially those with poorer performance or liver function who were left untreated compared to other studies. Nevertheless, including all patients is reasonable, as our goal was to build a model based on real-world data. Second, our study did not include the latest medications, such as atezolizumab-bevacizumab, durvalumab-tremelimumab, lenvatinib, cabozantinib, or ramucirumab, as our patient cohort was enrolled from 2013 to 2018.1–4 Due to the inherent limitations of our data, our model may not be directly applicable to patients who have received recent chemotherapeutic agents, and it will need continuous updates, including data from patients undergoing chemotherapy. Third, it may be difficult to generalize our model to different demographic populations because of the lack of external validation. In addition, we were unable to obtain or utilize data that might play a crucial role in survival, such as ECOG performance, cirrhosis, or treatment response after the initial anti-HCC treatment. Therefore, prospective validation and improvement of our model with a more diverse patient population and precise clinical data are required to overcome these limitations. Conclusion In conclusion, we successfully developed an accurate and reliable model for predicting the survival probability of HCC patients with extrahepatic metastasis using the XGBoost algorithm. Our model is easy to use and requires simple clinical data, making it accessible to both physicians and patients. We anticipate that our model will aid in individualized survival time estimation and provide valuable information for clinical decision making, ultimately leading to improved survival outcomes.