ObjectivesTo evaluate the efficacy of the Cox-Maze IV procedure (CMP-IV) in combination with valve surgery in patients with both atrial fibrillation (AF) and valvular disease and use machine learning algorithms to identify potential risk factors of AF recurrence.MethodsA total of 1,026 patients with AF and valvular disease from two hospitals were included in the study. 555 patients received the CMP-IV procedure in addition to valve surgery and left atrial appendage ligation (CMP-IV group), while 471 patients only received valve surgery and left atrial appendage ligation (Non-CMP-IV group). Kaplan–Meier analysis was used to calculate the sinus rhythm maintenance rate. 58 variables were selected as variables for each group and 10 machine learning models were developed respectively. The performance of the models was evaluated using five-fold cross-validation and metrics including F1 score, accuracy, precision, and recall. The four best-performing models for each group were selected for further analysis, including feature importance evaluation and SHAP analysis.ResultsThe 5-year sinus rhythm maintenance rate in the CMP-IV group was 82.13% (95% CI: 78.51%, 85.93%), while in the Non-CMP-IV group, it was 13.40% (95% CI: 10.44%, 17.20%). The eXtreme Gradient Boosting (XGBoost), LightGBM, Category Boosting (CatBoost) and Random Fores (RF) models performed the best in the CMP-IV group, with area under the curve (AUC) values of 0.768 (95% CI: 0.742, 0.786), 0.766 (95% CI: 0.744, 0.792), 0.762 (95% CI: 0.723, 0.801), and 0.732 (95% CI: 0.701, 0.763), respectively. In the Non-CMP-IV group, the LightGBM, XGBoost, CatBoost and RF models performed the best, with AUC values of 0.738 (95% CI: 0.699, 0.777), 0.732 (95% CI: 0.694, 0.770), 0.724 (95% CI: 0.668, 0.789), and 0.716 (95% CI: 0.656, 0.774), respectively. Analysis of feature importance and SHAP revealed that duration of AF, preoperative left ventricular ejection fraction, postoperative heart rhythm, preoperative neutrophil-lymphocyte ratio, preoperative left atrial diameter and heart rate were significant factors in AF recurrence.ConclusionCMP-IV is effective in treating AF and multiple machine learning models were successfully developed, and several risk factors were identified for AF recurrence, which may aid clinical decision-making and optimize the individual surgical management of AF.