Evaluation and comparison of machine learning algorithms for predicting discharge against medical advice in injured inpatients.

Dai, Xiu; Liu, Shifang; Chu, Xiangyuan; Jiang, Xuheng; Chen, Weihang; Qi, Guojia; Zhao, Shimin; Zhou, Yanna et al. · Surgery · 2025

retrospective_cohort · Level III

Where this comes from

Abstract

Whether the application of machine learning algorithms offers an advantage over logistic regression in forecasting discharge against medical advice occurrences needs to be evaluated. This retrospective study included all inpatient records from January 1, 2018, to December 31, 2023. The foundational data set (2018-2021) was divided into a training set (80%) and a test set (20%) for model construction and internal validation. The temporal validation data set (2022-2023) was used to assess the model's prospective performance. Feature selection was performed using the BorutaShap method. Techniques including random oversampling, random undersampling, synthetic minority oversampling technique, and edited nearest neighbors were applied to address data imbalance. Model performance was evaluated using metrics including the area under the receiver operating characteristic curve, accuracy, specificity, sensitivity, F1 score, and geometric mean. The Shapley Additive Explanations analysis provided interpretation for the best machine learning model. A total of 48,394 inpatient records for injured patients met the study criteria, of which 44,119 were discharged following medical advice and 4,275 chose discharge against medical advice, resulting in a ratio of 10.32:1. Among injury inpatients, 8.8% opted for discharge against medical advice. Based on the results of feature selection and multicollinearity analysis, 16 variables were ultimately selected for the construction and evaluation of the discharge against medical advice model. The light gradient boosting machine + edited nearest neighbors model showed the best generalization, with areas under the curves of 0.820 for internal validation and 0.837 for temporal validation. The Shapley Additive Explanations method was used to interpret the model, indicating that the grade of surgery is the most important variable. The study is the first to use machine learning models to predict discharge against medical advice in injured inpatients, demonstrating its feasibility. In the future, health care institutions can learn from these models to optimize patient management and reduce discharge against medical advice incidents.

Medical subject headings