Predicting Hospital Stay Length

Explainable Machine Learning System for Predicting Length of Hospital Stay (LOS) to Enable Smarter Resource Allocation and Data-Driven Healthcare Decisions.

Machine Learning Healthcare Analytics Explainable AI Random Forest Streamlit Data Science Consulting

Project Overview

This project demonstrates how explainable machine learning can be applied to healthcare operations by predicting the length of hospital stays (LOS) using real-world inpatient data. Accurate LOS prediction is critical for bed management, staffing, cost control, and patient flow optimisation.

Traditional models struggle to capture complex, non-linear drivers of LOS, and many AI solutions lack transparency. This system balances performance with interpretability to support clinical trust and adoption.

Project Goal

To develop an accurate and explainable ML-based system that predicts hospital stay length while remaining interpretable and usable by healthcare professionals.

Project Results & Visual Output

The following visual outputs demonstrate the ML model’s predictive performance, feature importance for interpretability, and the interactive Streamlit application dashboard for real-time hospital stay predictions.

Street Scene Segmentation Output

Hospital Length of Stay Prediction Dashboard.

Street Scene Segmentation Output

Hospital Length of Stay Prediction Dashboard.

Key Features & Achievements

Technologies Used

Machine Learning

  • Random Forest Regressor
  • Decision Tree
  • AdaBoost

Explainability

  • Feature Importance
  • XAI-Ready Architecture

Data Processing

  • Pandas, NumPy
  • OneHotEncoder
  • StandardScaler

Evaluation & Deployment

  • MAE, MSE, R² Score
  • Streamlit Web App
  • SPARCS Dataset (NY State)

Use Cases

What This Project Demonstrates

This project demonstrates the ability to build a production-ready, explainable healthcare ML system that bridges advanced machine learning with real-world clinical usability and trust.