BackgroundResearch on patients with cerebral infarction in the Intensive Care Unit (ICU) is still lacking. Our study aims to develop and validate multiple machine-learning (ML) models using two large ICU databases—Medical Information Mart for Intensive Care version III (MIMIC-III) and eICU Research Institute Database (eRI)—to guide clinical practice. MethodsWe collected clinical data from patients with cerebral infarction in the MIMIC-III and eRI databases within 24 h of admission. The opinion of neurologists and the Least Absolute Shrinkage and Selection Operator regression was used to screen for relevant clinical features. Using eRI as the training set and MIMIC-III as the test set, we developed and validated six ML models. Based on the results of the model validation, we select the best model and perform the interpretability analysis on it. ResultsA total of 4,338 patients were included in the study (eRI:3002, MIMIC-III:1336), resulting in a total of 18 clinical characteristics through screening. Model validation results showed that random forest (RF) was the best model, with AUC and F1 scores of 0.799 and 0.417 in internal validation and 0.733 and 0.498 in external validation, respectively; moreover, its sensitivity and recall were the highest of the six algorithms for both the internal and external validation. The explanatory analysis of the model showed that the three most important variables in the RF model were Acute Physiology Score-III, Glasgow Coma Scale score, and heart rate, and that the influence of each variable on the judgement of the model was consistent with medical knowledge. ConclusionBased on a large sample of patients and advanced algorithms, our study bridges the limitations of studies on this area. With our model, physicians can use the admission information of cerebral infarction patients in the ICU to identify high-risk groups among them who are prone to in-hospital death, so that they could be more alert to this group of patients and upgrade medical measures early to minimize the mortality of patients.