ObjectiveTo evaluate the use of machine learning algorithms for the prediction and characterization of cardiac thrombosis in patients with valvular heart disease and atrial fibrillation. MethodsThis article collected data of patients with valvular disease and atrial fibrillation from West China Hospital of Sichuan University and its branches from 2016 to 2021. From a total of 2 515 patients who underwent valve surgery, 886 patients with valvular disease and atrial fibrillation were included in the study, including 545 (61.5%) males and 341 (38.5%) females, with a mean age of 55.62±9.26 years, and 192 patients had intraoperatively confirmed cardiac thrombosis. We used five supervised machine learning algorithms to predict thrombosis in patients. Based on the clinical data of the patients (33 features after feature screening), the 10-fold nested cross-validation method was used to evaluate the predictive effect of the model through evaluation indicators such as area under the curve, F1 score and Matthews correlation coefficient. Finally, the SHAP interpretation method was used to interpret the model, and the characteristics of the model were analyzed using a patient as an example. ResultsThe final experiment showed that the random forest classifier had the best comprehensive evaluation indicators, the area under the receiver operating characteristic curve was 0.748±0.043, and the accuracy rate reached 79.2%. Interpretation and analysis of the model showed that factors such as stroke volume, peak mitral E-wave velocity and tricuspid pressure gradient were important factors influencing the prediction. ConclusionThe random forest model achieves the best predictive performance and is expected to be used by clinicians as an aided decision-making tool for screening high-embolic risk patients with valvular atrial fibrillation.