BackgroundSurgical resection is still the primary way to treat gastric cancer. Therefore, postoperative complications such as IAI (intra-abdominal infection) are major problems that front-line clinical workers should pay special attention to. This article was to build and validate IAI’s RF (regression function) model. Furthermore, it analyzed the prognosis in patients with IAI after surgery for stomach cancer. The above two points are our advantages, which were not involved in previous studies.MethodsThe data of this study was divided into two parts, the training data set and the validation data set. The training data for this article were from the patients treated surgically with gastric cancer in our center from December 2015 to February 2017. We examined IAI’s morbidity, etiological characteristics, and prognosis in the training data set. Univariate and multivariate logistic regression analyses were used to screen risk factors, establish an RF model and create a nomogram. Data from January to March 2021 were used to validate the accuracy of the RF model.ResultsThe incidence of IAI was 7.2%. The independent risk factors for IAI were hypertension (Odds Ratio [OR] = 3.408, P = 0.001), history of abdominal surgery (OR = 2.609, P = 0.041), combined organ excision (OR = 4.123, P = 0.010), and operation time ≥240 min (OR = 3.091, P = 0.005). In the training data set and validation data set, the area under the ROC curve of IAI predicted by the RF model was 0.745 ± 0.048 (P<0.001) and 0.736 ± 0.069 (P=0.003), respectively. In addition, IAI significantly extended the length of hospital stay but had little impact on survival.ConclusionsPatients with hypertension, combined organ excision, a history of abdominal surgery, and a surgical duration of 240 min or more are prone to IAI, and the RF model may help to identify them.