Abstract
BACKGROUND Transfusion thresholds in upper gastrointestinal bleeding (UGIB) are debated; hemoglobin cutoffs of 70–80 g/L are widely cited yet inconsistently applied. Common risk scores offer limited individualized guidance and rarely provide calibrated, interpretable predictions for transfusion decisions. OBJECTIVE To develop and validate a two-stage, clinically constrained gradient-boosting framework (Medically-Constrained Gradient Boosting, MGCB) that predicts transfusion need and estimates transfusion dose with quantified uncertainty, and to implement a prototype recommendation system for clinical use. METHODS We analyzed a retrospective multicenter cohort of 849 adults with endoscopically confirmed UGIB admitted to three hospitals in Chongqing, China (January 2019–August 2025). Predictors available before the transfusion decision included demographics, first recorded vital signs, initial laboratory indices, and clinician-adjudicated etiology. Stage 1 used a calibrated classifier with prespecified monotonic constraints and stability-screened, clinically justified interactions. Stage 2 modeled transfusion dose via quantile predictions with conformal adjustment to generate 95% prediction intervals. Performance was assessed using stratified five-fold cross-validation with discrimination (AUROC, AUPRC), calibration metrics and decision-curve analysis; regression performance included R², mean absolute error (MAE), and prediction-interval coverage. A graphical user interface was implemented to allow clinician input of patient data and to return calibrated transfusion probabilities and dose recommendations. RESULTS MGCB achieved strong discrimination and good calibration across subgroups (AUROC 0.97; AUPRC 0.91). At a probability threshold of 0.50, sensitivity, specificity, and F1 score were 0.99, 0.87, and 0.85, respectively. For dose prediction among transfused patients, MGCB achieved R² 0.95 and MAE 0.04; 95% prediction-interval coverage was 0.94, indicating accurate point estimates with reliable uncertainty quantification. The software prototype further demonstrated feasibility of real-time decision support at the bedside. CONCLUSIONS MGCB provides calibrated, interpretable predictions of transfusion need and individualized dose in UGIB and may support bedside decision-making and blood-bank planning, with a prototype interface demonstrating potential for clinical deployment. External validation in additional settings is warranted to confirm generalizability. CLINICALTRIAL Not applicable. This study does not involve a registered clinical trial or systematic review.

This publication has 33 references indexed in Scilit: