Predicting Length of Hospital stay for patients undergoing discectomy surgery using clinical and surgical parameters via machine learning
As one of the most frequent spine procedures, discectomy significantly impacts healthcare systems by extending postoperative length of stay (PLOS), which affects both patient recovery and resource management. This study evaluated machine learning models to identify key clinical predictors and accurately estimate hospital stay duration following discectomy. Potential factors influencing length of stay were initially gathered from existing literature and verified by a clinical expert panel. Medical records of 400 patients who underwent discectomy across three medical centers in Tabriz were analyzed. To address missing data (< 3.5%), simple imputation was applied after removing cases with high missingness. Data were partitioned into an 80% training set ( n = 320) and a 20% independent hold-out test set ( n = 80), with 5-fold cross-validation applied strictly during training. Six predictive algorithms—Linear Regression, LASSO Regression, Random Forest, XGBoost, Multilayer Perceptron (MLP), and Deep Neural Network (DNN)—were developed and evaluated. Model interpretability was further examined using global SHAP analysis. Postoperative blood loss, intraoperative blood loss, body mass index, age, duration of surgery, surgical instrumentation, and procedure location emerged as the highest-ranked predictors, whereas blood transfusion had the lowest impact. On the unseen test dataset, tree-based ensemble models achieved superior predictive accuracy compared to linear and deep learning approaches. The Random Forest model demonstrated the best overall performance (Mean Squared Error: 0.452, Explained Variance Score: 0.874, \(\:{R}^{2}\) : 0.874), closely followed by XGBoost ( \(\:{R}^{2}\) : 0.858), while LASSO ( \(\:{R}^{2}\) : 0.129) and linear baseline models yielded lower performance due to non-linear clinical feature interactions. Tree-based machine learning models, particularly Random Forest, offer promising capabilities for predicting hospital length of stay after discectomy. Identifying these key perioperative drivers can support clinical discharge planning, optimize bed capacity allocation, and improve hospital resource management.
Authors
- Ebrahim Rafiei
- Behzad Imani (ORCID: https://orcid.org/0000-0002-1544-8196)
- Samad Moslehi (ORCID: https://orcid.org/0000-0003-1597-7327)
- Alireza Jafarkhani (ORCID: https://orcid.org/0000-0002-1566-5203)
- Faezeh Mehdipour
Institutions
- Hamedan University of Medical Sciences (IR)
- Tabriz University of Medical Sciences (IR)
- Urmia University (IR)
- Urmia University of Medical Sciences (IR)
Publication Details
- Journal
- BMC Medical Informatics and Decision Making
- Published
- 2026-10-17
- DOI
- https://doi.org/10.1186/s12911-026-03915-1
- Primary Topic
- Artificial Intelligence in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Vice Chancellor for Research and Technology, Hamadan University of Medical Sciences