Prediction of gastrointestinal hemorrhage in cardiology inpatients using an interpretable XGBoost model.

Journal: Scientific reports
Published Date:

Abstract

Gastrointestinal bleeding (GIB) occurs more frequently in cardiovascular patients than in the general population, significantly affecting morbidity and mortality. However, existing predictive models often lack sufficient accuracy and interpretability. We developed an interpretable and practical machine learning model to predict the risk of GIB in cardiology inpatients. This retrospective study analyzed electronic health records of 10,706 patients admitted to the Department of Cardiology at the Second Hospital of Lanzhou University from October 8, 2019, to October 30, 2024. Variables with > 30% missing data were excluded, leaving 35 potential predictors. The dataset was randomly split into a training cohort (80%, n = 9,356) and a test cohort (20%, n = 2,340). GIB occurred in 110 patients (1.03%). Ten variables were identified as the strongest predictors: hemoglobin (importance score: 0.16), creatinine (0.12), D-dimer (0.10), NT-proBNP (0.06), glucose (0.06), white blood cell count (0.06), body weight (0.06), serum albumin (0.04), urea (0.04), and age (0.04). Among seven machine learning classifiers, XGBoost performed best, with an AUC of 0.995 in the validation cohort. In the validation set, the model achieved an accuracy of 0.975, sensitivity of 0.769, and specificity of 0.996. SHapley Additive exPlanations (SHAP) analysis confirmed hemoglobin, creatinine, and D-dimer as the top contributors to GIB risk. The model demonstrated excellent calibration (Brier score = 0.016), and decision curve analysis supported its clinical utility across various risk thresholds. The XGBoost model offers high accuracy and interpretability in predicting GIB risk among cardiology inpatients. It holds promise for clinical decision support by enabling early risk identification and personalized prevention strategies.

Authors

  • Yahui Li
    Key Laboratory of Ultra-Fast Photoelectric Diagnostics Technology, Xi'an Institute of Optics and Precision Mechanics, Xi'an 710049, China.
  • Xujie Wang
    Department of Emergency ICU, The Affiliated Hospital of Qinghai University, Xining, China.
  • Xuhui Liu
    Christian Doppler Laboratory for Ophthalmic Image Analysis, Department of Ophthalmology, Medical University of Vienna, Vienna, Austria 3Department of Ophthalmology, The First Affiliated Hospital of Zhengzhou University, Zhengzhou, China.