Comparative Analysis of K-NN and Naïve Bayes Algorithms for Early-Stage Chronic Kidney Disease Classification
Abstract
Chronic Kidney Disease (CKD) is a global health issue characterized by low early detection rates and high diagnostic costs. Artificial intelligence, particularly machine learning, offers a promising solution as a rapid and cost-effective decision support system. This study aims to comprehensively analyze and compare the performance of two simple and interpretable classification algorithms, K-Nearest Neighbor (K-NN) and Naïve Bayes (NB), for predicting CKD based on clinical data. The dataset was sourced from the UCI Machine Learning Repository, comprising 400 instances and 25 clinical attributes such as blood pressure and serum creatinine. The methodology included data preprocessing (median imputation for numerical features, mode imputation for categorical features), encoding, Min-Max normalization, data splitting (70:30 ratio), model training, K parameter optimization for K-NN via 5-fold cross-validation, and evaluation using accuracy, precision, recall, F1-Score, and Confusion Matrix metrics. Experimental results demonstrated that the Naïve Bayes algorithm achieved superior performance with an accuracy of 95.83%, precision of 95.95%, recall of 97.26%, and F1-Score of 96.60%. The K-NN algorithm with an optimal K=5 attained an accuracy of 91.67%. Statistical analysis using a paired t-test (α=0.05) with p-value=0.012 confirmed that this performance difference was significant. It is concluded that Naïve Bayes is more effective for this CKD dataset, likely due to its robustness in handling feature independence assumptions and varied data scales. This model holds strong potential for development into an early-stage CKD screening tool to assist healthcare professionals.
Downloads
References
V. Singh, V. K. Asari, and R. Rajasekaran, “A Deep Neural Network for Early Detection and Prediction of Chronic Kidney Disease,” Diagnostics, vol. 12, no. 1, p. 116, Jan. 2022, doi: 10.3390/diagnostics12010116.
R. C. Poonia et al., “Intelligent Diagnostic Prediction and Classification Models for Detection of Kidney Disease,” Healthcare, vol. 10, no. 2, p. 371, Feb. 2022, doi: 10.3390/healthcare10020371.
E. M. Senan et al., “Diagnosis of Chronic Kidney Disease Using Effective Classification Algorithms and Recursive Feature Elimination Techniques,” J. Healthc. Eng., no. 10.1155/2021/1004767, 2021, doi: 10.1155/2021/1004767.
V. Jackins, S. Vimal, M. Kaliappan, and M. Y. Lee, “AI-based smart prediction of clinical disease using random forest classifier and Naive Bayes,” J. Supercomput., vol. 77, no. 5, pp. 5198–5219, 2021, doi: 10.1007/s11227-020-03481-x.
I. Iswanto, T. Tulus, and P. Sihombing, “Comparison of Distance Models on K-Nearest Neighbor Algorithm in Stroke Disease Detection,” Appl. Technol. Comput. Sci. J., vol. 4, no. 1, pp. 63–68, 2021, doi: 10.33086/atcsj.v4i1.2097.
J. Hou, J. Zhang, W. Wu, T. Jin, and K. Zhou, “Research on Agricultural Machinery Rental Optimization Based on the Dynamic Artificial Bee-Ant Colony Algorithm,” Algorithms, vol. 15, no. 3, p. 88, Mar. 2022, doi: 10.3390/a15030088.
N. D. Phuong, N. T. Tuyen, V. T. T. Linh, N. N. Nguyen, and T. Q. Nguyen, “Machine Learning Techniques in Chronic Kidney Diseases: A Comparative Study of Classification Model Performance,” Bioinform. Biol. Insights, vol. 19, 2025, doi: 10.1177/11779322251356563.
F. Khalid et al., “Predicting the Progression of Chronic Kidney Disease: A Systematic Review of Artificial Intelligence and Machine Learning Approaches,” Cureus, vol. 16, no. 5, 2024, doi: 10.7759/cureus.60145.
A. S. Mahmoud, O. Lamouchi, and S. Belghith, “Advancements in Machine Learning and Deep Learning for Early Diagnosis of Chronic Kidney Diseases: A Comprehensive Review,” Babylonian J. Mach. Learn., vol. 2024, pp. 149–156, 2024, doi: 10.58496/BJML/2024/015.
P. Chittora et al., “Prediction of Chronic Kidney Disease - A Machine Learning Perspective,” IEEE Access, vol. 9, pp. 17312–17334, 2021, doi: 10.1109/ACCESS.2021.3053763.
W. T. Wu et al., “Data mining in clinical big data: the frequently used databases, steps, and methodological models,” Mil. Med. Res., vol. 8, no. 1, pp. 1–12, 2021, doi: 10.1186/s40779-021-00338-z.
V. Mehta et al., “Machine Learning based Exploratory Data Analysis (EDA) and Diagnosis of Chronic Kidney Disease (CKD),” EAI Endorsed Trans. Pervasive Heal. Technol., vol. 10, pp. 1–8, 2024, doi: 10.4108/eetpht.10.5512.
N. Khan et al., “Unveiling the predictive power: a comprehensive study of machine learning model for anticipating chronic kidney disease,” Front. Artif. Intell., vol. 6, 2023, doi: 10.3389/frai.2023.1339988.
S. Uddin, I. Haque, H. Lu, M. A. Moni, and E. Gide, “Comparative performance analysis of K-nearest neighbour (KNN) algorithm and its different variants for disease prediction,” Sci. Rep., vol. 12, no. 1, p. 6256, Apr. 2022, doi: 10.1038/s41598-022-10358-x.
J. Lu and H. Gweon, “Random k conditional nearest neighbor for high-dimensional data,” PeerJ Comput. Sci., vol. 11, 2025, doi: 10.7717/PEERJ-CS.2497.
S. A. Ebiaredoh-Mienye, T. G. Swart, E. Esenogho, and I. D. Mienye, “A Machine Learning Method with Filter-Based Feature Selection for Improved Prediction of Chronic Kidney Disease,” Bioengineering, vol. 9, no. 8, 2022, doi: 10.3390/bioengineering9080350.
J. K. Chen, Y. L. Sun, C. C. Hsu, T. I. Tseng, and Y. C. Liang, “Assessing Indoor Climate Control in a Water-Pad System for Small-Scale Agriculture in Taiwan: A CFD Study on Fan Modes,” Bioengineering, vol. 10, no. 4, pp. 1–17, 2023, doi: 10.3390/bioengineering10040452.
W. Yang, N. Ahmed, and A. L. C. Barczak, “Comparative Analysis of Machine Learning Algorithms for CKD Risk Prediction,” IEEE Access, vol. 12, no. August, pp. 171205–171220, 2024, doi: 10.1109/ACCESS.2024.3499355.
M. A. Islam, M. Z. H. Majumder, and M. A. Hussein, “Chronic kidney disease prediction based on machine learning algorithms,” J. Pathol. Inform., vol. 14, no. September 2022, p. 100189, 2023, doi: 10.1016/j.jpi.2023.100189.
M. S. Arif, A. Mukheimer, and D. Asif, “Enhancing the Early Detection of Chronic Kidney Disease: A Robust Machine Learning Model,” Big Data Cogn. Comput., vol. 7, no. 3, 2023, doi: 10.3390/bdcc7030144.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Comparative Analysis of K-NN and Naïve Bayes Algorithms for Early-Stage Chronic Kidney Disease Classification
Pages: 2459−2466
Copyright (c) 2026 Intan Dwi Rahma, Mhd Furqan, Budi Triandi

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under Creative Commons Attribution 4.0 International License that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (Refer to The Effect of Open Access).





















