Klasifikasi Penyakit Ginjal Kronis pada Data Tidak Seimbang Menggunakan K-Nearest Neighbor Berbasis Seleksi Fitur Mutual Information dan GridSearchCV
Abstract
Chronic Kidney Disease (CKD) is a progressive disease characterized by a gradual decline in kidney function and requires early detection to reduce the risk of severe complications. Machine learning has been widely applied to support CKD classification based on clinical attributes; however, medical datasets often contain missing values, a combination of numerical and categorical features, and class imbalance. This study aims to evaluate the performance of the K-Nearest Neighbor (KNN) algorithm for CKD classification using Mutual Information feature selection and GridSearchCV. The dataset consisted of 400 samples, including 250 CKD cases and 150 non-CKD cases. The proposed methodology included data cleaning, missing value imputation, categorical feature encoding, numerical feature normalization using MinMaxScaler, feature selection using SelectKBest with Mutual Information, and hyperparameter tuning using GridSearchCV. Model performance was evaluated using hold-out testing and 10-fold cross-validation. The hold-out evaluation showed that the KNN model with GridSearchCV achieved 100.00% accuracy, precision, recall, F1-score, and AUC on the test set. To ensure that this result was not dependent on a single train-test split, additional evaluation was conducted using 10-fold cross-validation. The cross-validation results yielded an average accuracy of 99.25% for the KNN model with GridSearchCV, indicating consistent performance across different data partitions. Meanwhile, the KNN model with Mutual Information feature selection and GridSearchCV achieved 98.75% accuracy, 100.00% recall, and a 99.01% F1-score, demonstrating competitive performance while using a more compact feature subset. The findings indicate that the application of GridSearchCV improved the performance of the KNN model on the dataset used, while Mutual Information contributed to selecting relevant features, enabling the model to maintain strong classification performance with a reduced number of features
References
I. Wisnuadji Gamadarenda and I. Waspada, “Implementasi Data Mining Untuk Deteksi Penyakit Ginjal Kronis (PGK) Menggunakan K-Nearest Neighbor (KNN) Dengan Backward Elimination,” Jurnal Teknologi Informasi dan Ilmu Komputer, vol. 7, no. 2, pp. 417–426, 2020, doi: 10.25126/jtiik.202071896.
D. Anggraini, “Aspek Klinis Dan Pemeriksaan Laboratorium Penyakit Ginjal Kronik,” An-Nadaa Jurnal Kesehatan Masyarakat, vol. 9, no. 2, p. 236, 2022, doi: 10.31602/ann.v9i2.9229.
R. Dewi and A. Mustofa, “Penurunan Intensitas Rasa Haus Pasien Penyakit Ginjal Kronik Yang Menjalani Hemodialisa Dengan Menghisap Es Batu,” Ners Muda, vol. 2, no. 2, p. 17, 2021, doi: 10.26714/nm.v2i2.7154.
R. Simorangkir, T. M. Andayani, and C. Wiedyaningsih, “Faktor-Faktor yang Berhubungan dengan Kualitas Hidup Pasien Penyakit Ginjal Kronis yang Menjalani Hemodialisis,” Jurnal Farmasi Dan Ilmu Kefarmasian Indonesia, vol. 8, no. 1, p. 83, 2021, doi: 10.20473/jfiki.v8i12021.83-90.
N. P. Nugraha, R. Azim, S. Z. Daffa, and P. S. Ningayu, “Perbandingan Akurasi Metode Naive Bayes dan Metode KNN untuk Memprediksi Gagal Ginjal Kronis,” Jurnal Rekayasa Elektro Sriwijaya, vol. 5, no. 1, pp. 1–10, 2023, doi: 10.36706/jres.v5i1.63.
H. D. Siswaja and Y. Ramdhani, “Pendekatan Algoritma Neural Network dan Genetic Algorithm Untuk Prediksi Penyakit Ginjal Kronis,” Jurnal Responsif, vol. 6, no. 2, pp. 232–239, 2024.
U. Hasanah, N. R. Dewi, L. Ludiana, A. T. Pakarti, and A. Inayati, “Analisis Faktor-Faktor Risiko Terjadinya Penyakit Ginjal Kronik Pada Pasien Hemodialisis,” Jurnal Wacana Kesehatan, vol. 8, no. 2, p. 96, 2023, doi: 10.52822/jwk.v8i2.531.
M. Rizal, M. Z. Syahaf, S. R. Priyambodo, and Y. Rhamdani, “Optimasi Algoritma Naive Bayes Menggunakan Forward Selection Untuk Klasifikasi Penyakit Ginjal Kronis,” Naratif, vol. 5, no. 1, pp. 71–80, 2023, doi: 10.53580/naratif.v5i1.200.
Q. A’yuniyah et al., “Implementasi Algoritma Naive Bayes Classifier untuk Klasifikasi Penyakit Ginjal Kronik,” Jurnal Sistem Komputer dan Informatika, vol. 4, no. 1, p. 72, 2022, doi: 10.30865/json.v4i1.4781.
G. N. Ahmad, H. Fatima, S. Ullah, A. Salah Saidi, and Imdadullah, “Efficient Medical Diagnosis of Human Heart Diseases Using Machine Learning Techniques With and Without GridSearchCV,” IEEE Access, vol. 10, pp. 80151–80173, 2022, doi: 10.1109/ACCESS.2022.3165792.
V. Wulandari, W. J. Sari, Z. Alfian, L. Legito, and T. Arifianto, “Implementasi Algoritma Naive Bayes Classifier dan K-Nearest Neighbor untuk Klasifikasi Penyakit Ginjal Kronik,” MALCOM, vol. 4, no. 2, pp. 710–718, 2024, doi: 10.57152/malcom.v4i2.1229.
N. Fatimah Indrianti, A. Kania Ningsih, and R. Ilyas, “Implementasi Data Mining Untuk Klasifikasi Penyakit Gagal Ginjal Kronis Menggunakan Metode K-Nearest Neighbor,” JATI, vol. 8, no. 2, pp. 2255–2260, 2024, doi: 10.36040/jati.v8i2.9464.
E. Laksono, A. Basuki, and F. Bachtiar, “Optimization of K Value in KNN Algorithm for Spam and Ham Email Classification,” Jurnal RESTI, vol. 4, no. 2, pp. 377–383, 2020, doi: 10.29207/resti.v4i2.1845.
S. T. Kusuma and T. B. Sasongko, “Optimasi K-Nearest Neighbor dengan Grid Search CV pada Prediksi Kanker Paru-Paru,” The Indonesian Journal of Computer Science, vol. 12, no. 4, pp. 2162–2171, 2023, doi: 10.33022/ijcs.v12i4.3267.
R. Fadilah, Y. H. Chrisnanto, and G. Abdillah, “Pengaruh metode pengukuran jarak dan SMOTE pada klasifikasi penilaian kredit,” JIRE, vol. 7, no. 2, pp. 193–202, 2024.
N. Rikatsih, M. Anshori, R. Siwi Pradini, and F. Faurika, “K-Nearest Neighbor Method for Early Detection of Diabetes Patients Based on Symptoms and Clinical Data,” Inform, vol. 9, no. 2, pp. 187–193, 2024, doi: 10.25139/inform.v9i2.8582.
Y. Putra Dinata, M. Fikry, F. Yanto, and E. Pandu Cynthia, “Analisis Sentimen Terhadap Sebuah Figur Publik di Twitter Menggunakan Metode K-Nearest Neighbor,” KLIK, vol. 4, no. 6, pp. 2822–2829, 2024, doi: 10.30865/klik.v4i6.1904.
Q. A’yuniyah et al., “Implementasi Algoritma Naive Bayes Classifier (NBC) untuk Klasifikasi Penyakit Ginjal Kronik,” Jurnal Sistem Komputer dan Informatika, vol. 4, no. 1, p. 72, 2022, doi: 10.30865/json.v4i1.4781.
E. Saputro and D. Rosiyadi, “Penerapan Metode Random Over-Under Sampling Pada Algoritma Klasifikasi Penentuan Penyakit Diabetes,” Bianglala Informatika, vol. 10, no. 1, pp. 42–47, 2022, doi: 10.31294/bi.v10i1.11739.
K. Widya Kayohana, “Klasifikasi Penyakit Hati Menggunakan Random Forest Dan KNN,” JATI, vol. 8, no. 4, pp. 7924–7929, 2024, doi: 10.36040/jati.v8i4.10457.
R. Rozaq, “Klasifikasi Penyakit Dengue Menggunakan Algoritma K-Nearest Neighbors Berbasis Flask,” Remik, vol. 6, no. 3, pp. 359–369, 2022, doi: 10.33395/remik.v6i3.11501.
N. M. Putry, “Komparasi Algoritma KNN Dan Naive Bayes Untuk Klasifikasi Diagnosis Penyakit Diabetes Mellitus,” EVOLUSI, vol. 10, no. 1, pp. 45–57, 2022, doi: 10.31294/evolusi.v10i1.12514.
I. P. Putri, “Analisis Performa Metode K-Nearest Neighbor (KNN) dan Crossvalidation pada Data Penyakit Cardiovascular,” Indonesian Journal of Data and Science, vol. 2, no. 1, pp. 21–28, 2021, doi: 10.33096/ijodas.v2i1.25.
Bila bermanfaat silahkan share artikel ini
Berikan Komentar Anda terhadap artikel Klasifikasi Penyakit Ginjal Kronis pada Data Tidak Seimbang Menggunakan K-Nearest Neighbor Berbasis Seleksi Fitur Mutual Information dan GridSearchCV
Pages: 1-11
Copyright (c) 2026 Mirza Afif Pradivta, Solikhun Solikhun, Timbo Faritcan P Siallagan

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).

