Implementation of the K-Neighbors Algorithm to Detect Diabetes Web Based Application

Mohammad Farrel Nur Rilwanu, Faris Huwaidi, Hibar Taufikurachman


Indonesia is the fifth country with the most diabetes sufferers in the world. This is influenced by an unhealthy lifestyle and then coupled with a lack of public awareness to check whether he has diabetes or not. The KNN (K-Nearest Neighbors) algorithm can be used to pr edict whether a person has diabetes. By using a dataset from the Pima Indian Diabetes Database, the data training process was carried out using the KNN algorithm and obtained decent accuracy results using a Jupyter notebook. From the results of the trained data set, it is then exported to be used in website development using the Python programming language. In the web application developed, the user is asked to input data on pregnancies (a person's pregnancy rate as long as he is alive), insulin levels, glucose levels, BMI, blood pressure, family history of diabetes, skin thickness, and age in the form of a slider. The input data is processed by the KNN algorithm to determine the outcome in the form of a positive or negative diabetes result based on the proximity of the new data entered with other data that has been trained.


Dataset; Diabetes; KNN; Prediction; Web Application

Full Text:



Englyst, H. N., Veenstra, J., & Hudson, G. J. (1996). Measurement of rapidly available glucose (RAG) in plant foods: a potential in vitro predictor of the glycaemic response. British Journal of Nutrition, 75(3), 327-337.

Farhud, D. D. (2015). Impact of lifestyle on health. Iranian journal of public health, 44(11), 1442-1444.

Guariguata, L., Whiting, D. R., Hambleton, I., Beagley, J., Linnenkamp, U., & Shaw, J. E. (2014). Global estimates of diabetes prevalence for 2013 and projections for 2035. Diabetes research and clinical practice, 103(2), 137-149.

Haryati, S. (2012). Research and development (R&D) sebagai salah satu model penelitian dalam bidang pendidikan. Majalah Ilmiah Dinamika, 37(1), 12-15.

Jousselme, A. L., & Maupin, P. (2012). Distances in evidence theory: Comprehensive survey and generalizations. International Journal of Approximate Reasoning, 53(2), 118-145.

Khorshid, S. F., & Abdulazeez, A. M. (2021). Breast cancer diagnosis based on k-nearest neighbors: a review. PalArch's Journal of Archaeology of Egypt/Egyptology, 18(4), 1927-1951.

Leidiana, H. (2013). Penerapan algoritma k-nearest neighbor untuk penentuan resiko kredit kepemilikan kendaraan bemotor. PIKSEL: Penelitian Ilmu Komputer Sistem Embedded and Logic, 1(1), 65-76.

Luthfa, I. (2019). Implementasi selfcare activity penderita diabetes mellitus di wilayah Puskesmas Bangetayu Semarang. Buletin Penelitian Kesehatan, 47(1), 23-28.

Amos, A. F., McCarty, D. J., & Zimmet, P. (1997). The rising global burden of diabetes and its complications: estimates and projections to the year 2010. Diabetic medicine, 14(S5), S7-S85.

Mailagaha Kumbure, M., & Luukka, P. (2022). A generalized fuzzy k-nearest neighbor regression model based on Minkowski distance. Granular Computing, 7(3), 657-671.

Moore, P. A., Orchard, T., Guggenheimer, J., & Weyant, R. J. (2000). Diabetes and oral health promotion: a survey of disease prevention behaviors. The Journal of the American Dental Association, 131(9), 1333-1341.

Nishom, M. (2019). Perbandingan akurasi euclidean distance, minkowski distance, dan manhattan distance pada algoritma K-Means clustering berbasis Chi-Square. Jurnal Informatika, 4(01), 20-24.

Norouzi, M., Fleet, D. J., & Salakhutdinov, R. R. (2012). Hamming distance metric learning. Advances in neural information processing systems, 6-8.

Ooi, H. L., Ng, S. C., & Lim, E. (2013). Ano detection with k-nearest neighbor using minkowski distance. International Journal of Signal Processing Systems, 1(2), 208-211.

Pamungkas, C. A. (2019). Aplikasi penghitung jarak koordinat berdasarkan latitude dan longitude dengan metode euclidean distance dan metode haversine. Jurnal Informa: Jurnal Penelitian dan Pengabdian Masyarakat, 5(2), 8-13.

Paramita, W. K., & Pratiwi, Y. M. (2022). Meta-Analysis Effects of Diabetes Mellitus on Mortality in Patients with Chronic Heart Failure. Journal of Epidemiology and Public Health, 7(1), 92-103.

Ul Hassan, I., Ali, R. H., Ul Abideen, Z., Khan, T. A., & Kouatly, R. (2022). Significance of machine learning for detection of malicious websites on an unbalanced dataset. Digital, 2(4), 501-519.

Wilson, D. L. (1972). Asymptotic properties of nearest neighbor rules using edited data. IEEE Transactions on Systems, Man, and Cybernetics, (3), 408-421.

Yosmar, R., Almasdy, D., & Rahma, F. (2018). Survei risiko penyakit diabetes melitus terhadap masyarakat Kota Padang. Jurnal sains farmasi & klinis, 5(2), 134-141.

Zhang, X., & Song, Q. (2014). Predicting the number of nearest neighbors for the k-NN classification algorithm. Intelligent Data Analysis, 18(3), 449-464.



  • There are currently no refbacks.

Copyright (c) 2022 Journal of Software Engineering, Information and Communication Technology (SEICT)

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Journal of Software Engineering, Information and Communicaton Technology (SEICT), 
2774-1699 | p-ISSN:2744-1656) published by Program Studi Rekayasa Perangkat Lunak, Kampus UPI di Cibiru.

 Indexed by.