BackgroundClostridioides difficile infection (CDI) is a leading cause of healthcare-associated infections and may result in organ dysfunction, colectomy, and death. We recently showed that published risk scores to predict severe complications from CDI demonstrate poor performance upon external validation. We hypothesized that building and validating a model using geographically and temporally distinct cohorts would more accurately identify patients at risk for complicated CDI.MethodsWe conducted a multi-center retrospective cohort study of adult subjects diagnosed with CDI in the US. After randomly partitioning the data into training/validation set, we developed and compared three machine learning algorithms (Lasso regression, random forest, stacked ensemble models) with 10-fold cross-validation that used structured EHR data collected within 48 hours of CDI diagnosis to predict disease-related complications from CDI (intensive care unit admission, colectomy, or death attributable to CDI within 30 days of diagnosis). Model performance was assessed using area under the receiver operating curve (AUC).ResultsA total of 3,762 patients with CDI were included of which 218 (5.8%) had complications. Lasso regression, random forest, and stacked ensemble models all performed well with AUC ranging between 0.89-0.9. Variables of importance were similar across models, including albumin, bicarbonate, change in creatinine, systolic blood pressure, non-CDI-related ICU admission, and concomitant non-CDI antibiotics. Sensitivity analyses indicated that model performance was robust even when varying derivation cohort inclusion and CDI testing approach.ConclusionUsing a large heterogeneous population of patients, we have developed and validated a prediction model based on structured EHR data that accurately estimates risk for complications from CDI.Key PointsMachine learning models using structured electronic health records can be leveraged to accurately predict risk of severe complications related to Clostridiodes difficile infection, including intensive care unit admission, colectomy, and/or death.