BackgroundCombining immunotherapy with surgical intervention is a prevailing and radical therapeutic strategy for individuals afflicted with gastric carcinoma; nonetheless, certain patients exhibit unfavorable prognoses even subsequent to this treatment regimen. This research endeavors to devise a machine learning algorithm to recognize risk factors with a high probability of inducing mortality among patients diagnosed with gastric cancer, both prior to and during their course of treatment.MethodsWithin the purview of this investigation, a cohort of 1015 individuals with gastric cancer were incorporated, and 39 variables encompassing diverse features were recorded. To construct the models, we employed three distinct machine learning algorithms, specifically extreme gradient boosting (XGBoost), random forest (RF), and k-nearest neighbor algorithm (KNN). The models were subjected to internal validation through employment of the k-fold cross-validation technique, and subsequently, an external dataset was utilized to externally validate the models.ResultsIn comparison to other machine learning algorithms employed, the XGBoost algorithm demonstrated superior predictive capacity regarding the risk factors that affect mortality after combination therapy in gastric cancer patients for a duration of one year, three years, and five years posttreatment. The common risk factors that significantly impacted patient survival during the aforementioned time intervals were identified as advanced age, tumor invasion, tumor lymph node metastasis, tumor peripheral nerve invasion (PNI), multiple tumors, tumor size, carcinoembryonic antigen (CEA) level, carbohydrate antigen 125 (CA125) level, carbohydrate antigen 72-4 (CA72-4) level, andH. pyloriinfection.ConclusionThe XGBoost algorithm can assist clinicians in identifying pivotal prognostic factors that are of clinical significance and can contribute toward individualized patient monitoring and management.