Related Experiment Video
Updated: Aug 9, 2025

A Machine Learning Approach to Design an Efficient Selective Screening of Mild Cognitive Impairment
Published on: January 11, 2020
Optimization of Tree-Based Machine Learning Models to Predict the Length of Hospital Stay Using Genetic Algorithm
Atefeh Mansoori1, Masoomeh Zeinalnezhad2, Leila Nazarimanesh3
1Department of Industrial Engineering, Science and Research Branch, Islamic Azad University, Tehran, Iran.
Predicting hospital length of stay (LOS) is crucial for resource management. This study optimized machine learning models, finding that the XGBoost model with genetic algorithm (GA) optimization significantly improved prediction accuracy, reducing errors by 37%.
Area of Science:
- Health Informatics
- Machine Learning in Healthcare
- Predictive Analytics
Background:
- Length of hospital stay (LOS) is a key metric for patient care quality, hospital efficiency, and operational resilience.
- Accurate LOS prediction is vital for effective hospital resource management and clinical decision support.
- Machine learning (ML) models offer potential for improving LOS prediction accuracy.
Purpose of the Study:
- To enhance the accuracy of length of hospital stay (LOS) prediction through hyperparameter optimization (HPO).
- To identify key variables influencing LOS by reviewing expert physician insights and existing literature.
- To evaluate and improve the performance of various ML models for LOS prediction.
Main Methods:
- Collected electronic medical records from 200 internal medicine patients in an Iranian hospital.
- Applied and evaluated several ML models including k-nearest neighbors (KNN), multivariate regression, decision tree (DT), random forest (RF), artificial neural network (ANN), and XGBoost.
- Utilized the genetic algorithm (GA) for hyperparameter optimization of tree-based models and dummy coding (One-Hot encoding) for categorical features.
Main Results:
- The XGBoost model optimized by the genetic algorithm (XGB_GA) demonstrated superior accuracy and prediction performance compared to other evaluated models.
- The XGB_GA model achieved a mean absolute error of 1.54 days and a median absolute error of 1.14 days on the test dataset.
- This optimized model reduced the mean absolute error by 37%, indicating a significant improvement in prediction reliability.
Conclusions:
- The XGBoost model optimized with the genetic algorithm (XGB_GA) provides a highly accurate and reliable method for predicting length of hospital stay.
- Improved LOS prediction accuracy facilitates better hospital resource management and planning.
- The developed XGB_GA model can be a valuable component in designing robust clinical decision support systems.
More Related Videos
07:35Selecting Multiple Biomarker Subsets with Similarly Effective Binary Classification Performances
Published on: October 11, 2018
04:09Predicting Treatment Response to Image-Guided Therapies Using Machine Learning: An Example for Trans-Arterial Treatment of Hepatocellular Carcinoma
Published on: October 10, 2018
Related Concept Videos
Survival Tree
Building a Survival Tree
Constructing a...
Mechanistic Models: Compartment Models in Algorithms for Numerical Problem Solving
In individual population analyses, different algorithms are employed, such as Cauchy's method, which uses a...
Parametric Survival Analysis: Weibull and Exponential Methods
Weibull Distribution
The Weibull distribution is a flexible model used in parametric survival analysis. It can handle both increasing and decreasing hazard rates, depending on its shape parameter...
Truncation in Survival Analysis
Left truncation occurs when individuals who experienced the event of interest before a certain time are not included in the study. This is often due to a "delayed entry" into the study where only those who survive until a certain entry point are...
Prediction Intervals
However, the point estimate is most likely not the exact value of the population parameter, but close to it. After calculating point estimates, we construct interval estimates, called confidence intervals or prediction intervals. This prediction interval comprises a range of values unlike the point estimate and is a better predictor of the observed sample value, y.
Comparing the Survival Analysis of Two or More Groups