Abstract
BACKGROUND: Nontraumatic subarachnoid hemorrhage (SAH) is a critical condition requiring prolonged hospitalization and significant healthcare costs. Identifying factors contributing to extended length of stay (LOS) and predicting associated hospital charges can optimize clinical decision-making and resource allocation. This study aimed to construct and validate machine learning (ML) models to predict extended LOS and total charges in SAH using a national database. METHODS: A retrospective cohort study was conducted using data from the National Inpatient Sample database, including 25,092 adult SAH patients. Twelve ML models were trained to predict extended LOS (defined as >17 days) based on clinical and demographic data. The variable screening process included univariate analysis, Spearman correlation analysis, least absolute shrinkage and selection operator (LASSO) regression, and Recursive Feature Elimination. SHapley Additive exPlanations (SHAP) values were used for model interpretation. Performance was assessed through receiver operating characteristic curves, precision-recall curves, calibration curves, and decision curve analysis (DCA). A decision tree model was also created to predict total hospital charges based on LOS. To identify factors contributing to high hospital charges in patients with extended LOS, univariate analysis, multivariate logistic regression, and LASSO regression were performed to select the most significant predictors. RESULTS: Among the 12 ML models, the Categorical Boosting (CatBoost) model demonstrated the highest predictive performance, with an area under the receiver operating characteristic curve of 0.904 upon internal validation and 0.910 on hold-out validation. The model's performance was optimal when 7 features were included, showing strong calibration and clinical applicability per DCA and SHAP. The decision tree model revealed a positive correlation between LOS and hospital charges. Additionally, key factors for predicting extended LOS and hospital charges included hydrocephalus, cerebral vasospasm, mechanical ventilation, and age. In patients with extended LOS, factors associated with high hospital charges were the total number of procedures, respiratory failure, tracheostomy, and hospital region. CONCLUSION: We constructed and validated ML models to predict extended LOS and hospital charges in SAH patients. The CatBoost model demonstrated strong predictive accuracy, while the decision tree model provided valuable insights into cost implications. Future multicenter studies are recommended to validate these models across diverse healthcare settings.