Optimasi Kinerja Algoritma K-Nearest Neighbor melalui Metode Random Forest untuk Klasifikasi Penyakit Ginjal
DOI:
https://doi.org/10.35870/jtik.v10i3.6372Keywords:
Chronic Kidney Disease, K-Nearest Neighbors, Random Forest, Classification, Machine LearningAbstract
Chronic Kidney Disease (CKD) is a chronic disease with a continuously increasing prevalence rate and requires early detection to prevent disease progression. This study aims to optimize the performance of the K-Nearest Neighbor (K-NN) algorithm in the classification of chronic kidney disease through the application of the Random Forest method. The dataset used comes from Kaggle and consists of 400 patient data with 26 clinical attributes. The research stages include data pre-processing in the form of handling missing values, categorical data transformation, feature normalization, and data division into training data and test data with a ratio of 80:20. Random Forest is used as a comparison method and optimization approach, while K-NN is used as the main classification algorithm. Model performance evaluation is carried out using accuracy, precision, recall, F1-score, and confusion matrix metrics. The test results show that the Random Forest algorithm obtains an accuracy value of 98.75%, while the K-NN algorithm produces an accuracy of 96.25%. These results prove that the application of Random Forest is able to optimize the performance of K-NN in the classification of chronic kidney disease effectively.
Downloads
References
Breiman, L. E. O. (2001). Random forests. Machine Learning, 45(1), 5–32. https://doi.org/10.1023/A:1010933404324.
Chicco, D., & Jurman, G. (2020). The advantages of the Matthews correlation coefficient (MCC) over F1 score and accuracy in binary classification evaluation. IEEE Access, 8, 1–13.
Diqi, M., Ordiyasa, I. W., & Hiswati, M. E. (2023). Comparative analysis of kidney disease detection using machine learning. Journal of Health Informatics, 15(2), 58–62.
Dritsas, E., & Trigka, M. (2022). Machine learning techniques for chronic kidney disease risk prediction.
Id, B. L., Schulte, T., & Groene, O. (2023). The application of machine learning to predict high-cost patients: A performance-comparison of different models using healthcare claims data. PLOS ONE, 1–16. https://doi.org/10.1371/journal.pone.0279540
Islam, M. A., Majumder, M. Z. H., & Hussein, M. A. (2023). Chronic kidney disease prediction based on machine learning algorithms. Journal of Pathology Informatics, 14, 100189. https://doi.org/10.1016/j.jpi.2023.100189
Jeon, H., & Oh, S. (2020). Hybrid-recursive feature elimination for efficient feature selection. Applied Sciences, 10(1), 1–8.
Khalid, H., Khan, A., Zahid Khan, M., Mehmood, G., & Shuaib Qureshi, M. (2023). Machine learning hybrid model for the prediction of chronic kidney disease. Computational Intelligence and Neurosciences, 2023, 1–12. https://doi.org/10.1155/2023/9266889.
Liu, P., Liu, Y., Liu, H., Xiong, L., Mei, C., & Yuan, L. (2024). A random forest algorithm for assessing risk factors associated with chronic kidney disease: Observational study. JMIR Medical Informatics, 8, 1–14. https://doi.org/10.2196/48378.
Majid, M., et al. (2023). Using ensemble learning and advanced data mining techniques to improve the diagnosis of chronic kidney disease. International Journal of Advanced Computer Science and Applications, 14(10), 470–480. https://doi.org/10.14569/IJACSA.2023.0141050.
Miaschi, A., Alzetta, C., Brunato, D., Orletta, F. D., & Venturi, G. (2023). Testing the effectiveness of the diagnostic probing paradigm on Italian treebanks.
Rady, E. A., & Anwar, A. S. (2019). Prediction of kidney disease stages using data mining algorithms. Informatics in Medicine Unlocked, 15, 100178. https://doi.org/10.1016/j.imu.2019.100178.
Rahim, R., & Ahmar, A. S. (2022). Cross-validation and validation set methods for choosing K in KNN algorithm for healthcare case study. Journal of Information Visualization, 3(1), 57–61. https://doi.org/10.35877/454ri.jinav1557
Schonlau, M., & Zou, R. Y. (2020). The random forest algorithm for statistical learning. Journal of Computational Statistics, 1, 3–29. https://doi.org/10.1177/1536867X20909688.
Siregar, M. R., Hartama, D., & Solikhun, S. (2025). Optimizing the KNN algorithm for classifying chronic kidney disease using GridSearchCV. JITK (Jurnal Ilmu Pengetahuan dan Teknologi Komputer), 10(3), 680–689. https://doi.org/10.33480/jitk.v10i3.6214
Son, J., & Lee, H. (2021). Contact-area-changeable CMP conditioning for enhancing pad lifetime. Applied Sciences, 11, 1–10.
Taqwimi, H. M. N., & Wahono, B. B. (2025). Implementation of random forest algorithm with RFE and SMOTE on cardiotocography dataset. International Journal of Health Informatics, 5(2), 139–146.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Achmad Hakim Qoirul Haq, Harminto Mulyo, Adi Sucipto

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
1. Copyright Retention and Open Access License
Authors retain copyright of their work and grant the journal non-exclusive right of first publication under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
This license allows unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
2. Rights Granted Under CC BY 4.0
Under this license, readers are free to:
- Share — copy and redistribute the material in any medium or format
- Adapt — remix, transform, and build upon the material for any purpose, including commercial use
- No additional restrictions — the licensor cannot revoke these freedoms as long as license terms are followed
3. Attribution Requirements
All uses must include:
- Proper citation of the original work
- Link to the Creative Commons license
- Indication if changes were made to the original work
- No suggestion that the licensor endorses the user or their use
4. Additional Distribution Rights
Authors may:
- Deposit the published version in institutional repositories
- Share through academic social networks
- Include in books, monographs, or other publications
- Post on personal or institutional websites
Requirement: All additional distributions must maintain the CC BY 4.0 license and proper attribution.
5. Self-Archiving and Pre-Print Sharing
Authors are encouraged to:
- Share pre-prints and post-prints online
- Deposit in subject-specific repositories (e.g., arXiv, bioRxiv)
- Engage in scholarly communication throughout the publication process
6. Open Access Commitment
This journal provides immediate open access to all content, supporting the global exchange of knowledge without financial, legal, or technical barriers.
