Prediksi Kebutuhan Rawat Inap Pasien Berdasarkan Data Hematologi Menggunakan Random Forest dengan Hyperparameter Optimization dan SHAP Explainability - Milla Akbarany Baktiar Putri Putri; Hana Titania Sastrian; Muhammad Erlangga Kurniawan; Andri Fauzan Adziima; Kartika Maulida Hindrayani; Muhammad Zulhaj Aliansyah (Journal of Computer Science and Information Technology, 2026)
Determining whether a patient requires inpatient or outpatient care is one of the most critical clinical decisions in healthcare facility management. Complete blood count (CBC) parameters provide routine and rapidly available physiological indicators, making them strong candidates for machine learning-based clinical decision support systems. This study aims to develop a prediction model for patient hospitalization needs using the Random Forest algorithm optimized through RandomizedSearchCV, combined with SHAP (SHapley Additive exPlanations) for model interpretability. The dataset consists of 4,412 patient records from an Indonesian private hospital available on Kaggle, containing nine hematological parameters and two demographic attributes. Feature engineering was applied by constructing three derived variables: leucocyte-thrombocyte ratio (leu_throm_ratio), hemoglobin-hematocrit ratio (hb_hct_ratio), and thrombocyte-age interaction (platelet_age). Two models were compared: a baseline Random Forest with manually configured hyperparameters and an optimized model using RandomizedSearchCV with Stratified 5-Fold Cross Validation. The baseline model achieved accuracy of .7633 and ROC AUC of .8097, while the optimized model yielded accuracy of .7644 and ROC AUC of .8131 on the test set. Feature importance analysis identified thrombocyte (.1655) and leu_throm_ratio (.1525) as the dominant predictors, together contributing over 31% of the model's predictive information. SHAP analysis confirmed that low thrombocyte values and high leucocyte values were the primary drivers of inpatient predictions, consistent with clinical indicators of infection and systemic inflammation. These findings demonstrate that Random Forest with clinically grounded feature engineering and SHAP interpretability provides a transparent and reasonably accurate approach for supporting hospital admission triage decisions.