Interpretable SHAP-based machine learning framework for patient satisfaction prediction: a case study in Thammasat
Tanatorn Tanantong1, Warut Pannakkong2, Nittaya Chemkomnerd1
1Thammasat University Research Unit in Data Innovation and Artificial Intelligence, Department of Computer Science, Faculty of Science and Technology, Thammasat University, Pathum Thani, 12120, Thailand.
BMC Medical Informatics and Decision Making
|July 3, 2026
Summary
Predicting patient satisfaction in ophthalmology outpatient departments is possible using machine learning. Length of stay was the most significant factor influencing patient satisfaction, according to explainable artificial intelligence analysis.
Area of Science:
- Healthcare Management
- Artificial Intelligence in Medicine
- Patient Experience Research
Background:
- Patient satisfaction is a key healthcare quality metric, especially in complex, resource-limited specialized outpatient settings.
- Understanding factors influencing satisfaction is crucial for improving healthcare services.
Purpose of the Study:
- To develop an explainable artificial intelligence (AI) framework for predicting patient satisfaction.
- To identify key factors affecting patient satisfaction in a public ophthalmology outpatient department.
Main Methods:
- Collected survey data, transforming patient satisfaction into binary and three-class settings.
- Evaluated multiple machine learning models (Random Forest, Gradient Boosting, XGBoost, CatBoost, LightGBM) using nested stratified cross-validation.
- Applied SMOTE-NC and G-SMOTENC for class imbalance, and used SHapley Additive exPlanations (SHAP) for model interpretation.
Main Results:
- Gradient Boosting with G-SMOTENC excelled in the binary setting; Random Forest was best for the three-class setting.
- SHAP analysis identified length of stay as the primary predictor of satisfaction.
- Demographic and visit-related variables also significantly influenced satisfaction predictions.
Conclusions:
- Combining predictive modeling with SHAP analysis offers transparent, context-specific patient satisfaction assessment.
- The interpretable insights can guide data-driven resource management and service improvements in specialized outpatient settings.
