Machine Learning-Based Prediction of Length of Stay and Hospital Costs Using Electronic Health Record Data

Riyadh Abdulhadi M Aljohani
Information Science Department, King Abdulaziz University, Jeddah, Saudi Arabia
Haitham Hussain Alkhayat
Information Science Department, King Abdulaziz University, Jeddah, Saudi Arabia

The increasing volume of healthcare data has created significant opportunities for applying machine learning techniques to improve financial management in hospital settings. This study aims to develop a predictive model for estimating hospital costs using structured Electronic Health Record (EHR) data. A Random Forest regression model was implemented to analyze the relationship between clinical and administrative variables, including diagnosis, diagnostic procedures, bed occupancy, physician information, and patient feedback, and their influence on hospital billing amounts. The dataset was divided into training and testing sets using an 80:20 split, and five-fold cross-validation was applied to evaluate model generalization. The proposed model achieved an R² value of 0.628 on the test set and a cross-validation mean R² of 0.623, indicating stable and reliable predictive performance. Feature importance analysis revealed that diagnostic procedures, particularly laboratory and imaging tests, were the most significant contributors to hospital cost variability. Residual analysis demonstrated balanced prediction behavior with no systematic bias, although higher variability was observed in extreme cost cases. The findings suggest that machine learning-based cost prediction models can effectively support hospital financial planning and resource allocation by identifying key cost drivers using routinely collected EHR data.

Abdulhadi M Aljohani, R., & Hussain Alkhayat, H. (2026). Machine Learning-Based Prediction of Length of Stay and Hospital Costs Using Electronic Health Record Data. Explainable Artificial Intelligence in Healthcare, 1(3), 231–244. https://doi.org/10.63913/xaih.v1i3.18
Views 8
PDF Downloads 9
Dimensions Citations

Citation data is supplied by Dimensions. New or unindexed publications may not yet have citation metrics.

Downloads

Download data is not yet available.

Similar Articles

1 2 > >> 

You may also start an advanced similarity search for this article.