Penerapan Algoritma Random Forest untuk Klasifikasi Tingkat Keparahan Penyakit pada Data Rekam Medis
Abstract
Accurate determination of disease severity is an important step in supporting medical decision-making. This study aims to classify the severity of patients’ diseases into three categories—Mild, Moderate, and Severe—using the Random Forest algorithm. The data used were obtained from patients’ medical records containing structured clinical parameters and have undergone a preprocessing stage, including data cleaning, variable transformation, and splitting into training data (80%) and testing data (20%). The test results show that the Random Forest model achieved an accuracy of 74.77%. The best performance was obtained in the Mild class with a recall value of 0.95 and an f1-score of 0.84. The Moderate class achieved a recall of 0.71 and an f1-score of 0.73, while the Severe class showed perfect precision (1.00) but a low recall (0.12), indicating the model’s limited ability to detect cases in this class. The macro average values for precision, recall, and f1-score were 0.83, 0.60, and 0.59 respectively, while the weighted average values were 0.78, 0.75, and 0.71 respectively. These findings indicate that Random Forest can be used to classify disease severity based on medical records with relatively good performance for the majority class, but further optimization—such as data balancing or parameter adjustment—is needed to improve sensitivity toward classes with fewer samples.
Full Text:
PDFReferences
Angloher, G., Banik, S., Bartolot, D., Benato, G., Bento, A., Bertolini, A., Breier, R., Bucci, C., Burkhart, J., Canonica, L., D’Addabbo, A., Di Lorenzo, S., Einfalt, L., Erb, A., Feilitzsch, F. v., Iachellini, N. F., Fichtinger, S., Fuchs, D., Fuss, A., … Waltenberger, W. (2023). Towards an automated data cleaning with deep learning in CRESST. European Physical Journal Plus, 138(1). https://doi.org/10.1140/epjp/s13360-023-03674-2
Araf, I., Idri, A. & Chairi, I. (2024). Cost-sensitive learning for imbalanced medical data: a review. Artificial Intelligence Review, 57(4). https://doi.org/10.1007/s10462-023-10652-8
Atika Sari, C. & Hari Rachmawanto, E. (2022). Sentiment Analyst on Twitter Using the K-Nearest Neighbors (KNN) Algorithm Against Covid-19 Vaccination. Journal of Applied Intelligent System, 7(2), 135–145. https://doi.org/10.33633/jais.v7i2.6734
Chiu, C. C., Wu, C. M., Chien, T. N., Kao, L. J., Li, C. & Jiang, H. L. (2022). Applying an Improved Stacking Ensemble Model to Predict the Mortality of ICU Patients with Heart Failure. Journal of Clinical Medicine, 11(21). https://doi.org/10.3390/jcm11216460
Datta, D., Mallick, P. K., Reddy, A. V. N., Mohammed, M. A., Jaber, M. M., Alghawli, A. S. & Al-qaness, M. A. A. (2022). A Hybrid Classification of Imbalanced Hyperspectral Images Using ADASYN and Enhanced Deep Subsampled Multi-Grained Cascaded Forest. Remote Sensing, 14(19). https://doi.org/10.3390/rs14194853
Hairani, H., Anggrawan, A. & Priyanto, D. (2023). Improvement Performance of the Random Forest Method on Unbalanced Diabetes Data Classification Using Smote-Tomek Link. International Journal on Informatics Visualization, 1(7), 258–264. https://doi.org/10.30630/joiv.7.1.1069
Hamdaoui, H. El, Boujraf, S., Chaoui, N. E. H., Alami, B. & Maaroufi, M. (2021). Improving Heart Disease Prediction Using Random Forest and AdaBoost Algorithms. International Journal of Online and Biomedical Engineering, 17(11), 60–75. https://doi.org/10.3991/ijoe.v17i11.24781
Husain, G., Nasef, D., Jose, R., Mayer, J., Bekbolatova, M., Devine, T. & Toma, M. (2025). SMOTE vs. SMOTEENN: A Study on the Performance of Resampling Algorithms for Addressing Class Imbalance in Regression Models. Algorithms, 18(1), 1–16. https://doi.org/10.3390/a18010037
Nugroho H, Y. D., Zakiyabarsi, F. & Paramita, A. J. (2025). Implementasi SMOTE-ENN dan Borderline SMOTE Terhadap Performa LightGBM Pada Imbalanced Class. Rabit : Jurnal Teknologi Dan Sistem Informasi Univrab, 10(1), 51–59. https://doi.org/10.36341/rabit.v10i1.5436
Reza, A. A. R. & Muhammad Syaifur Rohman. (2024). Prediction Stunting Analysis Using Random Forest Algorithm and Random Search Optimization. JOURNAL OF INFORMATICS AND TELECOMMUNICATION ENGINEERING, 7(2), 534–544. https://doi.org/10.31289/jite.v7i2.10628
Sarra, R. R., Gorial, I. I., Manea, R. R., Korial, A. E., Mohammed, M. & Ahmed, Y. (2024). Enhanced Stacked Ensemble-Based Heart Disease Prediction with Chi-Square Feature Selection Method. Journal of Robotics and Control (JRC), 5(6), 1753–1763. https://doi.org/10.18196/jrc.v5i6.23191
Sharma, H., Pangaonkar, S., Gunjan, R. & Rokade, P. (2023). Sentimental Analysis of Movie Reviews Using Machine Learning. International Conference on Data Science and Intelligent Applications, 53, 1–9. https://doi.org/10.1051/itmconf/20235302006
DOI: https://doi.org/10.36987/jcoins.v6i3.7993
Refbacks
- There are currently no refbacks.

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Jurnal ini mengikuti pedoman dari Committee on Publication Ethics (COPE) dalam menghadapi semua aspek etika publikasi dan, khususnya, bagaimana menangani kasus penelitian dan kesalahan publikasi. Pernyataan ini menjelaskan etika perilaku semua pihak yang terlibat dalam proses penerbitan artikel di jurnal ini, termasuk Penulis, Pemimpin Redaksi, Dewan Redaksi, Mitra Bebestari, dan Penerbit (Akademi Kepolisian Republik Indonesia). Journal of Computer Science and Information System(JCoInS) berkomitmen untuk mengikuti praktik terbaik tentang masalah etika, kesalahan, dan pencabutan. Pencegahan malpraktek publikasi merupakan salah satu tanggung jawab penting dewan redaksi. Segala jenis perilaku tidak etis tidak dapat diterima, dan jurnal tidak mentolerir plagiarisme dalam bentuk apa pun.
Journal URL: https://jurnal.ulb.ac.id/index.php/JCoInS/index
Journal DOI: 10.36987/jcoins
E-ISSN: 2747-2221
Alamat Redaksi :
Fakultas Sains dan Teknologi, Universitas Labuhanbatu
Gedung Fakultas Sains dan Teknologi,
Jalan Sisingamangaraja No.126 A KM 3.5 Aek Tapa, Bakaran Batu, Rantau Sel., Kabupaten Labuhan Batu, Sumatera Utara 21418