Objective. The incidence of cerebral infarction and myocardial infarction is higher in patients with carotid endarterectomy (CEA). Based on the concept of coprotection of heart and brain, this study attempts to screen the related factors of early cerebral infarction and myocardial infarction after CEA with the method of machine learning to provide clinical data for the prevention of postoperative cerebral infarction and myocardial infarction. Methods. 443 patients who received CEA operation under general anesthesia within 2 years were collected as the research objects. The demographic data, previous medical history, degree of neck vascular stenosis, blood pressure at all time points during the perioperative period, the time of occlusion, whether to place the shunt, and the time of hospital stay, whether to have cerebral infarction and myocardial infarction were collected. The machine learning model was established, and stable variables were selected based on single-factor analysis. Results. The incidence of cerebral infarction was 1.4% (6/443) and that of myocardial infarction was 2.3% (10/443). The hospitalization time of patients with cerebral infarction and myocardial infarction was longer than that of the control group (8 (7, 15) days vs. 7 (5, 8) days, ). The stable related factors were screened out by the xgboost model. The importance score ( score) was as follows: average arterial pressure during occlusion was 222 points, body mass index was 159 points, average arterial pressure postoperation was 156 points, the standard deviation of systolic pressure during occlusion was 153 points, diastolic pressure during occlusion was 146 points, mean arterial pressure after entry was 143 points, systolic pressure during occlusion was 121 points, and age was 117 points. Conclusion. Eight factors, such as blood pressure, body mass index, and age, may be related to the postoperative cerebral infarction and myocardial infarction in patients with CEA. The machine learning method deserves further study.