Skip to content
Open access

Development and implementation of a machine learning-based tool for predicting in-hospital adverse events in coronary heart disease

Sep 2026 · BMC Cardiovascular Disorders · 0 citations

Abstract

Coronary Heart Disease (CHD) is a leading cause of mortality worldwide. In-hospital adverse events remain a critical challenge affecting patient outcomes. Early identification of high-risk patients using predictive models could improve clinical outcomes. To develop and validate a machine learning-based prediction model for in-hospital adverse events in CHD patients, explore causal effects of key risk factors, and implement the model as a web-based clinical decision support tool. This retrospective cohort study included 1,288 CHD patients who underwent cardiac surgery at a tertiary hospital from January 2018 to December 2023. Patient demographics, laboratory test data (233 items with coverage rate $$\ge 5\%$$ ), surgical information, and in-hospital adverse events were collected. Variables with more than 60% missingness were removed, and patients with more than 10% missingness across the retained predictors were excluded from the primary analysis. After the training–test split, remaining item-level missingness was handled using MICE in the training set and training-derived median or mode imputation in the test set. LASSO regression was used for feature selection. Six machine learning algorithms (XGBoost, Random Forest, Logistic Regression, SVM, LightGBM, and Ensemble Model) were compared for prediction performance. Causal forest method was employed to explore the causal effects of key variables on adverse events. Model performance was evaluated using Area Under the Receiver Operating Characteristic Curve (AUC), accuracy, sensitivity, specificity, and F1-score. The optimal model was implemented as a web application using R Shiny framework. Among 1,288 patients, 272 (21.1%) experienced in-hospital adverse events. After LASSO feature selection within the training set, 9 key predictor variables were retained, including neutrophil percentage, albumin, bleeding volume, albumin/globulin ratio, and neutrophil absolute count. The Random Forest model achieved the best overall performance with an AUC of 0.7418 (95% CI: 0.6847–0.7990), sensitivity of 67.07%, specificity of 66.12%, and accuracy of 66.32%. Causal forest analysis demonstrated that red blood cell count had a protective effect, reducing adverse event risk by 6.76% (95% CI: 1.38–12.14%, p =0.014). The developed web application provides real-time risk assessment with model interpretability features, enabling clinicians to input patient data and obtain immediate, calibrated risk estimates with clinical recommendations. The Random Forest model demonstrated moderate discrimination for predicting in-hospital adverse events in CHD patients undergoing cardiac surgery. Causal forest analysis suggested that higher red blood cell count was associated with a lower estimated risk, whereas the effects of the other evaluated predictors were not statistically significant. The web application illustrates the potential clinical translation of the model but requires external and prospective validation before routine use.

Read PDF

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.