ObjectiveTo analyze the predictive value of ensemble classification algorithm of random forest for delirium risk in ICU patients with cardiothoracic surgery. MethodsA total of 360 patients hospitalized in cardiothoracic ICU of our hospital from June 2019 to December 2020 were retrospectively analyzed. There were 193 males and 167 females, aged 18-80 (56.45±9.33) years. The patients were divided into a delirium group and a control group according to whether delirium occurred during hospitalization or not. The clinical data of the two groups were compared, and the related factors affecting the occurrence of delirium in cardiothoracic ICU patients were predicted by the multivariate logistic regression analysis and the ensemble classification algorithm of random forest respectively, and the difference of the prediction efficiency between the two groups was compared.ResultsOf the included patients, 19 patients fell out, 165 patients developed ICU delirium and were enrolled into the delirium group, with an incidence of 48.39% in ICU, and the remaining 176 patients without ICU delirium were enrolled into the control group. There was no statistical significance in gender, educational level, or other general data between the two groups (P>0.05). But compared with the control group, the patients of the delirium group were older, length of hospital stay was longer, and acute physiology and chronic health evaluationⅡ(APACHEⅡ) score, proportion of mechanical assisted ventilation, physical constraints, sedative drug use in the delirium group were higher (P<0.05). Multivariate logistic regression analysis showed that age (OR=1.162), length of hospital stay (OR=1.238), APACHEⅡ score (OR=1.057), mechanical ventilation (OR=1.329), physical constraints (OR=1.345) and sedative drug use (OR=1.630) were independent risk factors for delirium of cardiothoracic ICU patients. The variables in the random forest model for sorting, on top of important predictor variable were: age, length of hospital stay, APACHEⅡ score, mechanical ventilation, physical constraints and sedative drug use. The diagnostic efficiency of ensemble classification algorithm of random forest was obviously higher than that of multivariate logistic regression analysis. The area under receiver operating characteristic curve of ensemble classification algorithm of random forest was 0.87, and the one of multivariate logistic regression analysis model was 0.79.ConclusionThe ensemble classification algorithm of random forest is more effective in predicting the occurrence of delirium in cardiothoracic ICU patients, which can be popularized and applied in clinical practice and contribute to early identification and strengthening nursing of high-risk patients.