Prediksi Kebutuhan Rawat Inap Pasien Berdasarkan Data Hematologi Menggunakan Random Forest dengan Hyperparameter Optimization dan SHAP Explainability
DOI:
https://doi.org/10.70716/jocsit.v2i2.650Keywords:
Hematology, Hospitalization prediction, Random Forest, Electronic health records, SHAPAbstract
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.
Downloads
References
Ajumoke, A. (2025). Interpreting Machine Learning Predictions with SHAP and LIME for Transparent Decision Making. International Journal of Computer Science and Mathematical Theory, 11(8), 2025. https://doi.org/10.56201/ijcsmt.vol.11.no8.2025.pg22.49
ALMUTHAYBIRI, A. R., Bawazir, A. A. B., Almutairi, F. A. M., Almutairi, A. A., Faqeehi, M. H., & Al-Harbi, T. F. M. (2025). Complete Blood Count (CBC) Interpretation and Analysis: A Comprehensive Review for Medical Laboratory Professionals. Journal of Posthumanism, 5(1). https://doi.org/10.63332/joph.v5i1.3144
Araújo, D. C., de Macedo, A. A., Veloso, A. A., Alpoim, P. N., Gomes, K. B., Carvalho, M. das G., & Dusse, L. M. S. A. (2024). Complete blood count as a biomarker for preeclampsia with severe features diagnosis: a machine learning approach. BMC Pregnancy and Childbirth, 24(1). https://doi.org/10.1186/s12884-024-06821-4
Azad, M., Nehal, T. H., & Moshkov, M. (2025). A novel ensemble learning method using majority based voting of multiple selective decision trees. Computing, 107(1). https://doi.org/10.1007/s00607-024-01394-8
Busnatu, Ștefan, Niculescu, A. G., Bolocan, A., Petrescu, G. E. D., Păduraru, D. N., Năstasă, I., Lupușoru, M., Geantă, M., Andronic, O., Grumezescu, A. M., & Martins, H. (2022). Clinical Applications of Artificial Intelligence—An Updated Overview. In Journal of Clinical Medicine (Vol. 11, Number 8). Multidisciplinary Digital Publishing Institute (MDPI). https://doi.org/10.3390/jcm11082265
Çakmak, Y. (2025). Machine Learning Approaches for Enhanced Diagnosis of Hematological Disorders. Computational Systems and Artificial Intelligence, 1(1), 8–14. https://doi.org/10.69882/adba.csai.2025072
Feretzakis, G., Sakagianni, A., Loupelis, E., Kalles, D., Panteris, V., Tzelves, L., Chatzikyriakou, R., Trakas, N., Kolokytha, S., Batiani, P., Rakopoulou, Z., Tika, A., Petropoulou, S., Dalainas, I., & Kaldis, V. (2022). Prediction of Hospitalization Using Machine Learning for Emergency Department Patients. Studies in Health Technology and Informatics, 294, 145–146. https://doi.org/10.3233/SHTI220422
Fuse, Y., Murphy, S. N., Ikari, H., Takahashi, A., Fuse, K., & Kawakami, E. (2025). Artificial intelligence in clinical data analysis: A review of large language models, foundation models, digital twins, and allergy applications. In Allergology International (Vol. 74, Number 4, pp. 499–513). Japanese Society of Allergology. https://doi.org/10.1016/j.alit.2025.06.005
Liu, J., Gou, Y., Yang, W., Wang, H., Zhang, J., Wu, S., Liu, S., Tao, T., Tang, Y., Yang, C., Chen, S., Wang, P., Feng, Y., Zhang, C., Liu, S., Peng, X., & Zhang, X. (2025). Development and application of machine learning models for hematological disease diagnosis using routine laboratory parameters: a user-friendly diagnostic platform. Frontiers in Medicine, 12. https://doi.org/10.3389/fmed.2025.1605868
Lovatti, B. P. O., Nascimento, M. H. C., Neto, Á. C., Castro, E. V. R., & Filgueiras, P. R. (2019). Use of Random forest in the identification of important variables. Microchemical Journal, 145, 1129–1134. https://doi.org/10.1016/j.microc.2018.12.028
Lundberg, S. M., & Lee, S.-I. (2017). A Unified Approach to Interpreting Model Predictions.In Advances in Neural Information Processing Systems 30 (NeurIPS 2017), 4765-4774.https://doi.org/10.48550/arXiv.1705.07874
Mahendra, B., Pratama, D., Faqih, A., & Kurniawan, R. (2021). JURNAL SISTEM INFORMASI DAN TEKNOLOGI ( S I N T E K ) PENGARUH KUALITAS DATA TERHADAP PERFORMA MODEL MACHINE LEARNING DALAM PENDEKATAN DATA-CENTRIC AI. Jurnal Sistem Informasi Dan Teknologi (SINTEK). https://sintek.stmikku.ac.id/index.php/home
Noor, A. A., Manzoor, A., Mazhar Qureshi, M. D., Qureshi, M. A., & Rashwan, W. (2025). Unveiling Explainable AI in Healthcare: Current Trends, Challenges, and Future Directions. Wiley Interdisciplinary Reviews: Data Mining and Knowledge Discovery, 15(2). https://doi.org/10.1002/widm.70018
Olamendy, J. C. (2024). A Comprehensive Guide to Stratified K-Fold Cross-validation for Unbalanced Data.Medium.https://medium.com/@juanc.olamendy/mastering-feature-scaling-and-normalization-in-machine-learning-985fdecfab5c
Peng, Y., Liu, X., & Zhang, H. (2025). Pengembangan Model Random Forest untuk Prediksi Kesehatan Jiwa Berbasis Data Klinis Terstruktur dan Tidak Terstruktur. Jurnal Jusinfo, 1(1), 1-10. [web:102]
Ribeiro, M. T., Singh, S., & Guestrin, C. (2024). Practical guide to SHAP analysis: Explaining supervised machine learning models for drug development. Journal of Biomedical Informatics, 58(3), 11513550. https://doi.org/10.1016/j.ymed.2024.11513550
Savioli, G., Ceresa, I. F., Gri, N., Piccini, G. B., Longhitano, Y., Zanza, C., Piccioni, A., Esposito, C., Ricevuti, G., & Bressan, M. A. (2022). Emergency Department Overcrowding: Understanding the Factors to Find Corresponding Solutions. In Journal of Personalized Medicine (Vol. 12, Number 2). MDPI. https://doi.org/10.3390/jpm12020279
Staritz, C., & Schdeel, K. (2025). Cross-Validation in Machine Learning: Model Evaluation Guide. Useful Data Tips, 11(2), 99-104. https://doi.org/10.1111/useful.2025.0099
Steinbach, D., Ahrens, P. C., Schmidt, M., Federbusch, M., Heuft, L., Lübbert, C., Nauck, M., Gründling, M., Isermann, B., Gibb, S., & Kaiser, T. (2024). Applying Machine Learning to Blood Count Data Predicts Sepsis with ICU Admission. Clinical Chemistry, 70(3), 506–515. https://doi.org/10.1093/clinchem/hvae001
Swarnadwip Bose, M., & Bose, M. S. (2025). Random Forests: The Wisdom of Crowds in Action. Journal of Emerging Trends in Computer Science and Applications (JETCSA), 1(1), 67–91. https://www.swamivivekanandauniversity.ac.in/jetcse/
Thamer, M., & Sultani, Z. N. (2025). Explainable AI in the Medical Field: A Survey on Machine Learning Interpretability and Use Cases. Al-Nahrain Journal of Science, 28(4), 188–206. https://doi.org/10.22401/ANJS.28.4.15
Tjahjono, A. F., Hasan, H., Putera, R. P., Indranto, D. M. P., & Hermawan, A. T. (2025). Klasifikasi URL Phishing untuk SIEM: Perbandingan Model Machine Learning XGBoost dan Deep Learning TabNet dalam Deteksi Ancaman Siber. Sains Data Jurnal Studi Matematika Dan Teknologi, 3(2), 62–71. https://doi.org/10.52620/sainsdata.v3i2.227
Utami, E. W., Kurniawan, D., & Kunci, K. (2026). Optimasi Hyperparameter Random Forest untuk Klasifikasi Depresi Mahasiswa Menggunakan GridSearchCV dan RandomizedSearchCV. Technology and Science (BITS), 7(4). https://doi.org/10.47065/bits.v7i4.9366
Vimbi, V., Shaffi, N., & Mahmud, M. (2024). Interpreting artificial intelligence models: a systematic review on the application of LIME and SHAP in Alzheimer’s disease detection. In Brain Informatics (Vol. 11, Number 1). Springer Science and Business Media Deutschland GmbH. https://doi.org/10.1186/s40708-024-00222-1
Yazdi, A., Noori, M., Ayyoubzadeh, S. M., Naghdi, S., & Saeedi, S. (2026). Predicting triage levels in patients presenting with cardiac-related symptoms: a comparison of supervised machine learning methods. BMC Emergency Medicine, 26(1). https://doi.org/10.1186/s12873-025-01427-1
Zhai, G., Wang, J., Liu, Y., & Zhou, Y. (2021). Platelet-lymphocyte ratio as a new predictor of in-hospital mortality in cardiac intensive care unit patients. Scientific Reports, 11(1). https://doi.org/10.1038/s41598-021-02686-1
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Milla Akbarany Baktiar Putri Putri, Hana Titania Sastrian, Muhammad Erlangga Kurniawan, Andri Fauzan Adziima, Kartika Maulida Hindrayani, Muhammad Zulhaj Aliansyah

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.







