BackgroundInfectious complications after colorectal cancer (CRC) surgery increase perioperative mortality and are significantly associated with poor prognosis. We aimed to develop a model for predicting infectious complications after colorectal cancer surgery in elderly patients based on improved machine learning (ML) using inflammatory and nutritional indicators.MethodsThe data of 512 elderly patients with colorectal cancer in the Third Affiliated Hospital of Anhui Medical University from March 2018 to April 2022 were retrospectively collected and randomly divided into a training set and validation set. The optimal cutoff values of NLR (3.80), PLR (238.50), PNI (48.48), LCR (0.52), and LMR (2.46) were determined by receiver operating characteristic (ROC) curve; Six conventional machine learning models were constructed using patient data in the training set: Linear Regression, Random Forest, Support Vector Machine (SVM), BP Neural Network (BP), Light Gradient Boosting Machine (LGBM), Extreme Gradient Boosting (XGBoost) and an improved moderately greedy XGBoost (MGA-XGBoost) model. The performance of the seven models was evaluated by area under the receiver operator characteristic curve, accuracy (ACC), precision, recall, and F1-score of the validation set.ResultsFive hundred twelve cases were included in this study; 125 cases (24%) had postoperative infectious complications. Postoperative infectious complications were notably associated with 10 items features: American Society of Anesthesiologists scores (ASA), operation time, diabetes, presence of stomy, tumor location, NLR, PLR, PNI, LCR, and LMR. MGA-XGBoost reached the highest AUC (0.862) on the validation set, which was the best model for predicting postoperative infectious complications in elderly patients with colorectal cancer. Among the importance of the internal characteristics of the model, LCR accounted for the highest proportion. Conclusions: This study demonstrates for the first time that the MGA-XGBoost model with 10 risk factors might predict postoperative infectious complications in elderly CRC patients.