Objective: To identify the independent risk factors for postoperative pulmonary complications (PPCs) in middle-aged and elderly patients after thoracoscopic lung resection surgery based on machine learning. Methods: The perioperative data of middle-aged and elderly patients, aged 60-84 years, BMI 18.5-32.0 kg/m2, ASA physical status Ⅱ or Ⅲ, who underwent elective thoracoscopic lung surgery from August 2020 to August 2023 were collected. Patients were divided into two groups based on whether PPCs occurred: the PPCs group and the non-PPCs group. Univariate analysis was first used to screen associated factors, then a random forest model was built for prediction, and the Shapley additive explanations (SHAP) framework was applied to interpret the model's decision-making process, quantifying the contribution and direction of each feature. Results: A total of 392 patients were included, and 104 patients (26.5%) developed PPCs. Univariate analysis showed gender, age, height, weight, predicted body weight, smoking history, diffusing capacity of the lungs for carbon monoxide (DLCO), ARISCAT score, duration of surgery, intraoperative colloid infusion volume, tidal volume, optimal positive end-expiratory pressure (PEEP) during one-lung ventilation were associated with PPCs (P < 0.05). The random forest model predicted PPCs with an accuracy of 0.80 and an area under the receiver operating characteristic curve (AUCROC) of 0.88 (95% CI 0.82-0.91). SHAP analysis indicated that the ARISCAT score was the most important factor for predicting PPCs, followed by extended surgery time, male gender, advanced age (≥ 75 years), smoking history, high intraoperative colloid infusion volume, and high tidal volume. Subgroup analysis revealed that for patients with an ARISCAT score ≥ 43 or moderately impaired lung function(FEV1 50%-70%), higher individualized PEEP(9-13 cmH2O) were associated with a reduced risk of PPCs. Conclusion: An increase in ARISCAT score, prolonged operation time, advanced age, male gender, smoking history, high intraoperative colloid fluid infusion volume, and high tidal volume are risk factors for PPCs in middle-aged and elderly patients undergoing thoracoscopic lung surgery. |