The study developed a machine learning model to predict 30-day unplanned readmission in lung cancer patients after lobectomy or sublobectomy in ambulatory surgery. 380 patients from the period December 2022 - January 2025 were analyzed, of which 111 experienced readmission. LASSO selected 12 predictive factors: age, payment category, prothrombin time (PT), white blood cell (WBC) count, hemoglobin, intraoperative blood loss, surgical approach, pathologic diagnosis, tumor number and size, occupation category, and FEV1. The best was the random forest model with a ROC-AUC of 0.939 and an accuracy of 0.825 on the validation set (30% of the data). The SHAP analysis identified WBC, PT, hemoglobin, blood loss, and "unknown" occupational category as major risk factors, with WBC, PT, and blood loss increasing risk. The model showed good calibration and benefit in thresholds of 10–80%. The identified factors support early risk stratification and targeted interventions in ambulatory care.