A Diabetes Prediction Model Based on BMI, HbA1c, Age, and Blood Glucose Using KNN
DOI:
https://doi.org/10.55123/jomlai.v5i2.5429Keywords:
Prediction, Machine Learning, Diabetes, K-Nearest Neighbors, KNNAbstract
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
How to Cite
Issue
Section
License
Copyright (c) 2026 Avelina Garcia Wong, Devin Hernando, Marcelyn Wijaya, Thomas Herpin, Vinola Lorencia, Ade Maulana

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Copyright (c) 2022 The authors. Published by Yayasan Literasi Indonesia
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
The author(s) whose article is published in the JOMLAI journal attain the copyright for their article and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. By submitting the manuscript to JOMLAI, the author(s) agree with this policy. No special document approval is required.
The author(s) guarantee that:their article is original, written by the mentioned author(s),
- has never been published before,
- does not contain statements that violate the law, and
- does not violate the rights of others, is subject to copyright held exclusively by the author(s), and is free from the rights of third parties, and that the necessary written permission to quote from other sources has been obtained by the author(s).
The author(s) retain all rights to the published work, such as (but not limited to) the following rights:
- Copyright and other proprietary rights related to the article, such as patents,
- The right to use the substance of the article in its own future works, including lectures and books,
- The right to reproduce the article for its own purposes,
- The right to archive all versions of the article in any repository, and
- The right to enter into separate additional contractual arrangements for the non-exclusive distribution of published versions of the article (for example, posting them to institutional repositories or publishing them in a book), acknowledging its initial publication in this journal (JOMLAI: Journal of Machine Learning and Artificial Intelligence).
Suppose the article was prepared jointly by more than one author. Each author submitting the manuscript warrants that all co-authors have given their permission to agree to copyright and license notices (agreements) on their behalf and notify co-authors of the terms of this policy. JOMLAI will not be held responsible for anything that may arise because of the writer's internal dispute. JOMLAI will only communicate with correspondence authors.
Authors should also understand that their articles (and any additional files, including data sets, and analysis/computation data) will become publicly available once published. The license of published articles (and additional data) will be governed by a Creative Commons Attribution-ShareAlike 4.0 International License. JOMLAI allows users to copy, distribute, display and perform work under license. Users need to attribute the author(s) and JOMLAI to distribute works in journals and other publication media. Unless otherwise stated, the author(s) is a public entity as soon as the article is published



















