Abstract
BACKGROUND: Delayed extubation after general anesthesia increases complications and can lead to longer hospital stays and higher mortality. Current risk assessments often rely on subjective judgment or simple tools, whereas machine learning offers potential for real-time evaluation, though research is limited and typically uses single-algorithm models. OBJECTIVE: The aims of this study were to identify risk factors for delayed extubation after general anesthesia in the sample and to construct a risk prediction model for delayed extubation in this population. METHODS: Data from 4779 patients admitted to the postanesthesia care unit between September 2023 and May 2024 were used to develop prediction models for delayed extubation using k-nearest neighbor, decision tree, extreme gradient boosting, random forest, a light gradient boosting machine, and an artificial neural network. Model performance was assessed by calculating the area under the receiver operating characteristic curve, sensitivity, specificity, accuracy, F1-score, and Brier score. Calibration performance was evaluated using calibration curves generated with 100-bin quantile calibration and Loess smoothing to provide bias-corrected and smoothed visual assessment. Additionally, the Hosmer-Lemeshow goodness-of-fit test was performed to quantitatively evaluate calibration, with P values >.05 indicating good calibration. RESULTS: Among the 6 models evaluated, the extreme gradient boosting model demonstrated the best performance, with an area under the receiver operating characteristic curve of 0.750 (95% CI 0.703-0.796), a sensitivity of 0.734 (95% CI 0.635-0.827), and a specificity of 0.647 (95% CI 0.623-0.673). The model calibration was acceptable, with a Brier score of 0.0505 and a nonsignificant Hosmer-Lemeshow goodness-of-fit test (χ²6=7.3; P=.287), indicating good calibration. Shapley additive explanations were used to rank feature importance. CONCLUSIONS: These machine learning models enable early identification of delayed extubation risk, supporting personalized clinical decisions and optimizing postanesthesia care unit resource allocation.