Application of KNN Machine Learning and Fuzzy C-Means to Diagnose Diabetes

  • Anthony Anggrawan Universitas Bumigora, Mataram, Indonesia
  • Mayadi Mayadi Universitas Bumigora, Mataram, Indonesia
Keywords: Diabetes, Machine Learning, Fuzzy C-means, K-Nearest Neighbor


The disease is a common thing in humans. Diseases that attack humans do not know anyone and do not know age. The disease experienced by a person starts from an ordinary level until it can be declared severe to the point of being at risk of death. In this study, the early diagnosis was carried out related to diabetes, where diabetes is a condition in which the sufferer’s body has low sugar levels above normal. Symptoms experienced by sufferers include frequent thirst, frequent urination, frequent hunger, and weight loss. Based on these problems, a system is needed that can quickly find out the diagnosis experienced by a patient. This research aimed to diagnose diabetes early on based on early symptoms. The methods used are KNN and web-based fuzzy C-means. Creating a web-based system can represent medical personnel experts in a fast-diagnosing approach to diabetes. This system was a computer program embedded with the knowledge of the characteristics of diabetes. The results of testing the KNN and Fuzzy C-means applications and methods get an accuracy of 96% for the KNearest Neighbor method, while for the Fuzzy C-Means method with Confusion Matrix calculations, an accuracy of 96% is obtained, so it can be concluded that the Fuzzy C-means method Means better than the K-Nearest Neighbor method.


Download data is not yet available.


[1] P. W. Ramadhan, “Sistem Pakar Diagnosa Penyakit Umum Menggunakan Metode Forward Chaining Berbasis Web,” Jurnal
Informatika, vol. 6, pp. 1–14, 2019.
[2] F. Handayanna, “Diabetes Mellitus Dengan Metode Support Vector Machine Berbasis Particle Swarm,” Jurnal Teknik Informatika
STMIK Antar Bangsa, vol. II, no. 1, pp. 30–37, 2016.
[3] R. A. Siallagan and Fitriyani, “Prediksi Penyakit Diabetes Mellitus Menggunakan Algoritma C4.5,” Jurnal Responsif : Riset
Sains dan Informatika, vol. 3, no. 1, pp. 44–52, 2021.
[4] M. Dennedy, R. Rizza, and S. Dinneen, Classification and Diagnosis of Diabetes Mellitus. Endocrinology: Adult and Pediatric.
Elsevier Inc., 2015.
[5] F. M. Hana, “Klasifikasi Penderita Penyakit Diabetes Menggunakan Algoritma Decision Tree C4.5,” Jurnal SISKOM-KB (Sistem
Komputer dan Kecerdasan Buatan), vol. 4, no. 1, pp. 32–39, 2020.
[6] E. Cousin et al., “Diabetes mortality and trends before 25 years of age: an analysis of the Global Burden of Disease Study
2019,” The Lancet Diabetes and Endocrinology, vol. 10, no. 3, pp. 177–192, 2022.
[7] P. Subarkah, I. Santiko, and A. Tri, “Perbandingan Kinerja Algoritma Cart dan Naive Bayesian untuk Mendiagnosa Penyakit
Diabetes Melitus,” Conference on Information Technology, Information System and Electrical Engineering, p. 17, 2017.
[8] A. Bevan and N. Patel, “An Electronic Prescription Alerting System-Improving the Discharge Medicines Process,” Archives of
disease in childhood, vol. 101, no. 9, p. e2, sep 2016.
[9] A. Tsyben, N. Gooding, and W. Kelsall, “Assessing the Impact of a Newly Introduced Electronic Prescribing System Across
a Paediatric Department Lessons Learned,” Archives of Disease in Childhood, vol. 101, no. 9, pp. e2—-e2, 2016. [Online].
[10] A. Anggrawan et al., “Machine Learning for Diagnosing Drug Users and Types of Drugs Used,” International Journal of
Advanced Computer Science and Applications, vol. 12, no. 11, pp. 111–118, 2021.
[11] F. Aris and Benyamin, “Penerapan Data Mining untuk Identifikasi Penyakit Diabetes Melitus dengan Menggunakan Metode
Klasifikasi,” Router Research, vol. 1, no. 1, pp. 1–6, 2019.
[12] I. P. D. Lesmana, “Pengembangan Decision Tree J48 Untuk Diagnosis Penyakit Diabetes Mellitus,” Seminar Nasional Teknologi
Informasi & Komunikasi Terapan, vol. 2, no. 1, p. 23, 2012.
[13] P. Achenbach et al., “A Classification and Regression Tree Analysis Identifies Subgroups of Childhood Type 1 Diabetes,”
eBioMedicine, vol. 82, p. 104118, 2022. [Online]. Available:
[14] N. Dwitiyanti, N. Selvia, and F. R. Andrari, “Penerapan Fuzzy C-Means Cluster dalam Pengelompokkan Provinsi Indonesia
Menurut Indikator Kesejahteraan Rakyat,” Faktor Exacta, vol. 12, no. 3, p. 201, 2019.
[15] Y. Ambar, Kusrini, and Henderi, “Penerapan Algoritma K-Nearest Neighbour Dalam Menentukan Pembinaan Koperasi Kabupaten
Kotawaringin Timur,” Jurnal Pengembangan Teknologi Informasi dan Ilmu Komputer, vol. 1, no. 5, pp. 1–8, 2019.
[16] N. G. A. Dasriani, M. Mayadi, and A. Anggrawan, “Klasterisasi Lokasi Promosi PMB Dengan Fuzzy C-means Masa Pandemi
Covid 19,” MATRIK : Jurnal Manajemen, Teknik Informatika dan Rekayasa Komputer, vol. 21, no. 2, pp. 327–336, 2022.
[17] Wahyono, “Peningkatan Kecepatan Algoritma K-NN Untuk Sistem Pengklasifikasian Kendaraan Bermotor,” Techno.Com,
vol. 19, no. 2, pp. 190–196, 2020.
[18] Z. Zhang, “Introduction to machine learning : k-nearest neighbors,” Annals of Translational Medicine, vol. 4, no. 11, pp. 1–7,
[19] D. Prasad et al., “System Model for Prediction Analytics Using K-Nearest Neighbors Algorithm,” Journal of Computational
and Theoretical Nanoscience, vol. 16, no. 10, pp. 4425–4430, 2019.
[20] P. Guleria, S. Ahmed, A. Alhumam, and P. N. Srinivasu, “Empirical Study on Classifiers for Earlier Prediction of COVID-19
Infection Cure and Death Rate in the Indian States,” Healthcare (Switzerland), vol. 10, no. 1, 2022.
[21] A. Yosipof, R. C. Guedes, and A. T. Garc´ıa-sosa, “Data Mining and Machine Learning Models for Predicting Drug Likeness
and Their Disease or Organ Category,” Frontiers in Chemistry, vol. 6, no. May, pp. 1–11, 2018.
[22] J. Bullock, A. Luccioni, K. H. Pham, and M. Luengo-oroz, “Mapping the Landscape of Artificial Intelligence Applications
against COVID-19,” Journal of Artificial Intelligence Research, vol. 69, no. 1, pp. 807–845, 2020.
[23] L. Wynants et al., “Prediction models for diagnosis and prognosis of covid-19 : systematic review and critical appraisal,” The
BMJ, vol. 369, pp. 1–22, 2020.
[24] A. Anggrawan, “Interaction between Learning Preferences and Methods in Face-to-Face and Online Learning,” ICIC Express
Letters, vol. 15, no. 4, pp. 319–326, 2021.
[25] J. Gong et al., “A Tool to Early Predict Severe Corona Virus Disease 2019 (COVID-19) : A Multicenter Study using the
Risk Nomogram in Wuhan and Guangdong, China,” The Journals of Gerontology Series A: Biological Sciences and Medical
Sciences, vol. 0813, no. April, pp. 1–11, 2018.
[26] X. Jiang et al., “Towards an artificial intelligence framework for data-driven prediction of coronavirus clinical severity,” Computers,
Materials and Continua, vol. 63, no. 1, pp. 537–551, 2020.
[27] J. Liu et al., “Neutrophil-to-lymphocyte ratio predicts critical illness patients with 2019 coronavirus disease in
the early stage,” Journal of Translational Medicine, vol. 18, no. 1, pp. 1–12, 2020. [Online]. Available:
[28] K. A. Tikki, H. H. Jaber, and A. A. Mahdi, “Estimation of Serum Uric Acid in Type II Diabetic Patients and Relationship with
Anemia,” HIV Nursing, vol. 22, no. 2, pp. 1523–1526, 2022.
[29] M. Rahman, D. Alamsah, M. Darmawidjadja, and I. Nurma, “Klasifikasi Untuk Diagnosa Diabetes Menggunakan Metode
Bayesian Regularization Neural Network (RBNN),” Jurnal Informatika, vol. 11, no. 1, p. 36, 2017.
[30] E. Purwaningsih and E. Nurelasari, “Penerapan K-Nearest Neighbor Untuk Klasifikasi Tingkat Kelulusan Pada Siswa,” Syntax
: Jurnal Informatika, vol. 10, no. 01, pp. 46–56, 2021.
[31] A. W. Fadillah, A. Tejawati, and N. Puspitasari, “Penerapan Fuzzy C-Means Pada Curah Hujan Di Kalimantan Timur,” Jurnal
Rekayasa Teknologi Informasi (JURTI), vol. 2, no. 1, p. 82, 2018.
[32] R. J. Sarjanako, “Penerapan Fuzzy C-Means Clustering Untuk Mengoptimalkan Penentuan Media Promosi,” Teknois : Jurnal
Ilmiah Teknologi Informasi dan Sains, vol. 6, no. 1, pp. 29–37, 2019.
[33] A. Anggrawan, N. Ibrahim, S. Muslim, and C. Satria, “Interaction between learning style and gender in mixed learning with
40and 60Science and Applications, vol. 10, no. 5, pp. 407–413, 2019.
How to Cite
Anggrawan, A., & Mayadi, M. (2023). Application of KNN Machine Learning and Fuzzy C-Means to Diagnose Diabetes. MATRIK : Jurnal Manajemen, Teknik Informatika Dan Rekayasa Komputer, 22(2), 405-418.