Development and implementation of explainable AI-based machine learning models for predicting hospital stay and

Alireza Banaye Yazdipour1,2, Parisa Mehdizadeh3, Masoud Arabfard4

  • 1Department of Health Information Technology, School of Paramedical and Rehabilitation Sciences, Mashhad University of Medical Sciences, Mashhad, Iran.

Scientific Reports
|December 28, 2025
PubMed

Insights

Machine learning models accurately predict hospital length of stay and treatment costs for cardiovascular disease patients undergoing angioplasty or CABG. The developed tool aids clinical decisions and resource planning.

Area of Science:

  • Cardiovascular Medicine
  • Health Informatics
  • Machine Learning

Background:

  • Cardiovascular disease (CVD) is a leading cause of mortality and significant healthcare expenditure.
  • Predictive tools are crucial for managing hospital length of stay (LOS) and treatment costs in CVD patients undergoing procedures like angioplasty and coronary artery bypass grafting (CABG).

Purpose of the Study:

  • To develop and validate machine learning (ML) models for predicting hospital LOS and treatment costs in cardiovascular inpatients.
  • To create an explainable and clinically implementable decision support application.

Main Methods:

  • A retrospective study analyzed 7685 adult inpatients undergoing angioplasty or CABG.
  • Eight regression-based ML algorithms were trained to predict LOS, patient out-of-pocket costs, insurer payments, and total treatment costs.
  • Model performance was assessed using R², RMSE, and MAE; SHAP analysis provided interpretability.

Main Results:

  • The XGBoost model demonstrated superior performance across all prediction tasks.
  • On the test set, XGBoost achieved R² values of 0.7802 for LOS, 0.8473 for patient OOP, 0.8946 for insurer payment, and 0.6437 for total cost.
  • SHAP analysis identified LOS, intervention type, age, and comorbidities as key predictors.

Conclusions:

  • A comprehensive, explainable ML framework was developed for predicting LOS and treatment costs in cardiovascular care.
  • The deployed dual-platform application offers real-time, personalized predictions to support clinical and administrative decision-making.
  • Future research should focus on external validation and incorporating broader variables for enhanced generalizability.