A Diabetes Prediction Model Based on BMI, HbA1c, Age, and Blood Glucose Using KNN

Authors

  • Avelina Garcia Wong Universitas Pelita Harapan
  • Devin Hernando Universitas Pelita Harapan
  • Marcelyn Wijaya Universitas Pelita Harapan
  • Thomas Herpin Universitas Pelita Harapan
  • Vinola Lorencia Universitas Pelita Harapan
  • Ade Maulana Universitas Pelita Harapan

DOI:

https://doi.org/10.55123/jomlai.v5i2.5429

Keywords:

Prediction, Machine Learning, Diabetes, K-Nearest Neighbors, KNN

Abstract

Diabetes is a chronic disease with a globally increasing prevalence and poses a serious health risk if not detected early. This study aims to develop a simple yet accurate classification model to predict diabetes risk using the K-Nearest Neighbors (KNN) algorithm. The model utilizes four key clinical parameters: body mass index (BMI), blood glucose level, glycated hemoglobin (HbA1c), and age. The dataset used in this study was obtained from Kaggle and consists of 50,066 records. The data underwent preprocessing stages including normalization, class balancing, and feature selection before being split into training (70%), testing (20%), and validation (10%) sets. Experimental results demonstrate that the KNN model with k=4 achieves an accuracy of 83% on the validation set and 82% on the test set. Although the model shows stable and reasonably good performance, further improvement is needed to achieve better class balance in prediction. Future work may involve exploring more advanced machine learning techniques to enhance predictive capabilities and ensure fair classification across different risk groups.

References

[1] “Diabetes.” Accessed: Apr. 09, 2025. [Online]. Available: https://www.who.int/news-room/fact-sheets/detail/diabetes

[2] L. E. Wagenknecht et al., “Trends in incidence of youth-onset type 1 and type 2 diabetes in the USA, 2002–18: results from the population-based SEARCH for Diabetes in Youth study,” Lancet Diabetes Endocrinol, vol. 11, no. 4, pp. 242–250, Apr. 2023, doi: 10.1016/S2213-8587(23)00025-6.

[3] D. Wahyu, H.  Jurusan, I. Kesehatan, I. Keolahragaan, D. Disetujui, and ________________ D., “FAKTOR-FAKTOR YANG BERHUBUNGAN DENGAN KEPATUHAN DALAM PENGELOLAAN DIET PADA PASIEN RAWAT JALAN DIABETES MELLITUS TIPE 2 DI KOTA SEMARANG,” 2017. [Online]. Available: http://journal.unnes.ac.id/sju/index.php/jhealthedu/

[4] V. Durlach et al., “Smoking and diabetes interplay: A comprehensive review and joint statement,” Diabetes Metab, vol. 48, no. 6, Nov. 2022, doi: 10.1016/J.DIABET.2022.101370.

[5] D. Mohajan and H. K. Mohajan, “Visceral Fat Increases Cardiometabolic Risk Factors Among Type 2 Diabetes Patients,” Innovation in Science and Technology, vol. 3, no. 5, pp. 26–30, Sep. 2024, doi: 10.56397/IST.2024.09.03.

[6] L. Ismail, H. Materwala, and J. Al Kaabi, “Association of risk factors with type 2 diabetes: A systematic review,” Comput Struct Biotechnol J, vol. 19, p. 1759, Jan. 2021, doi: 10.1016/J.CSBJ.2021.03.003.

[7] S. Rahayu and Stik. Jayakarta PKP DKI Jakarta, “HUBUNGAN USIA, JENIS KELAMIN DAN INDEKS MASSA TUBUH DENGAN KADAR GULA DARAH PUASA PADA PASIEN DIABETES MELITUS TIPE 2 DI KLINIK PRATAMA RAWAT JALAN PROKLAMASI, DEPOK, JAWA BARAT,” 2020.

[8] “Indonesia - International Diabetes Federation.” Accessed: Apr. 09, 2025. [Online]. Available: https://idf.org/our-network/regions-and-members/western-pacific/members/indonesia/

[9] M. S. Fiqri and H. Dwi Bhakti, “KLASIFIKASI POTENSI PENYAKIT DIABETES MELLITUS TIPE II PADA PASIEN MENGGUNAKAN ALGORITME KNN (K-NEAREST NEIGHBOR),” 2024.

[10] N. Azizah, M. R. Firdaus, R. Suyaningsih, F. Indrayatna, and U. Padjadjaran, “Penerapan Algoritma Klasifikasi K-Nearest Neighbor pada Penyakit Diabetes,” 2023, [Online]. Available: http://prosiding.snsa.statistics.unpad.ac.id

[11] A. Asmarani et al., “Jurnal Informatika Dan Rekayasa Komputer (JAKAKOM) Implementasi Algoritma K-Nearst Neighbor Untuk Memprediksi Penyakit Diabetes,” 2022. [Online]. Available: https://ejournal.unama.ac.id/index.php/jakakom

[12] A. Gunawan and I. Fenriana, “Design of Diabetes Prediction Application Using K-Nearest Neighbor Algorithm,” bit-Tech, vol. 6, no. 2, pp. 110–117, Dec. 2023, doi: 10.32877/bt.v6i2.939.

[13] N. Kouiroukidis and G. Evangelidis, “The Effects of Dimensionality Curse in High Dimensional kNN Search,” in 2011 15th Panhellenic Conference on Informatics, 2011, pp. 41–45. doi: 10.1109/PCI.2011.45.

[14] G. Manikandan and S. Abirami, “An efficient feature selection framework based on information theory for high dimensional data,” Appl Soft Comput, vol. 111, p. 107729, 2021, doi: https://doi.org/10.1016/j.asoc.2021.107729.

[15] P. Shen, X. Ding, W. Ren, and S. Liu, “A stable feature selection method based on relevancy and redundancy,” in Journal of Physics: Conference Series, IOP Publishing Ltd, Jan. 2021. doi: 10.1088/1742-6596/1732/1/012023.

[16] Centers for Disease Control and Prevention, “Laporan Statistik Diabetes Nasional.” Accessed: Apr. 21, 2025. [Online]. Available: https://www.cdc.gov/diabetes/php/data-research/index.html

[17] S. Klein, A. Gastaldelli, H. Yki-Järvinen, and P. E. Scherer, “Why does obesity cause diabetes?,” Cell Metab, vol. 34, no. 1, pp. 11–20, 2022, doi: https://doi.org/10.1016/j.cmet.2021.12.012.

[18] American Diabetes Association, “Glycemic targets: Standards of medical care in diabetes-2020,” Diabetes Care, vol. 43, pp. S66–S76, Jan. 2020, doi: 10.2337/dc20-S006.

[19] H. Gupta, H. Varshney, T. K. Sharma, N. Pachauri, and O. P. Verma, “Comparative performance analysis of quantum machine learning with deep learning for diabetes prediction,” Complex & Intelligent Systems, vol. 8, no. 4, pp. 3073–3087, 2022.

[20] A. F. Lubis et al., “Classification of Diabetes Mellitus Sufferers Eating Patterns Using K-Nearest Neighbors, Na"ive Bayes and Decission Tree,” Public Research Journal of Engineering, Data Technology and Computer Science, vol. 2, no. 1, pp. 44–51, 2024.

[21] Q. Wei and R. L. Dunbrack, “The Role of Balanced Training and Testing Data Sets for Binary Classifiers in Bioinformatics,” PLoS One, vol. 8, no. 7, Jul. 2013, doi: 10.1371/journal.pone.0067863.

Downloads

Published

2026-06-15

How to Cite

Avelina Garcia Wong, Hernando, D., Wijaya, M., Herpin, T., Lorencia, V., & Ade Maulana. (2026). A Diabetes Prediction Model Based on BMI, HbA1c, Age, and Blood Glucose Using KNN. JOMLAI: Journal of Machine Learning and Artificial Intelligence, 5(2), 49–56. https://doi.org/10.55123/jomlai.v5i2.5429

Issue

Section

Articles