Skip to main navigation Skip to search Skip to main content

A Comparative Study of Random Forest and K-Nearest Neighbors for Predicting Hypertension and Diabetes

  • Shupei Qiao*
  • *Corresponding author for this work

Research output: Chapters, Conference Papers, Creative and Literary WorksRGC 32 - Refereed conference paper (with host publication)peer-review

Abstract

Hypertension (HTN) and Diabetes Mellitus (DM) are global health threats with an increase in prevalence and economic burden. This study assessed how well the K-nearest neighbor (KNN) and Random Forest (RF) models performed, for predicting these diseases using a Kaggle dataset containing 26,084 patient records. Models were trained on eight clinical variables, including age, cholesterol, and BP after preprocessing and principal component analysis (PCA) feature selection. The RF model performed well in predicting hypertension, demonstrating its robustness to class imbalance and ability to capture complex feature interactions, with 99.6% accuracy, 100% precision, 99.0% recall, and only two false negatives. In contrast, KNN showed moderate results in predicting diabetes (82.95% accuracy and 81.55% precision) but with a high false negative rate (29.74%), highlighting its sensitivity to noise and imbalance. These results make RF superior for screening hypertension, where minimizing underdiagnosis is critical. For predicting diabetes, the potential of KNN needs to be optimized using techniques such as SMOTE oversampling and parameter tuning. This study supports the use of radiofrequency technology in clinical settings. At the same time, further research is needed to improve the reliability of KNN. In future work, better and higher quality data standards can be incorporated, and these methods can be validated in medical practice to maximize their impact on the early intervention of disease. © 2025 IEEE.
Original languageEnglish
Title of host publication2025 IEEE 3rd International Conference on Image Processing and Computer Applications (ICIPCA)
PublisherIEEE
Pages326-331
Number of pages6
ISBN (Electronic)979-8-3315-2284-1, 979-8-3315-2283-4
ISBN (Print)979-8-3315-2285-8
DOIs
Publication statusPublished - 2025
Externally publishedYes
Event3rd IEEE International Conference on Image Processing and Computer Applications (ICIPCA 2025) - Shenyang, China
Duration: 28 Jun 202530 Jun 2025

Publication series

NameIEEE International Conference on Image Processing and Computer Applications, ICIPCA

Conference

Conference3rd IEEE International Conference on Image Processing and Computer Applications (ICIPCA 2025)
PlaceChina
CityShenyang
Period28/06/2530/06/25

UN SDGs

This output contributes to the following UN Sustainable Development Goals (SDGs)

  1. SDG 3 - Good Health and Well-being
    SDG 3 Good Health and Well-being

Research Keywords

  • Diabetes Mellitus
  • Hypertension
  • K-Nearest Neighbors
  • Random Forest

Fingerprint

Dive into the research topics of 'A Comparative Study of Random Forest and K-Nearest Neighbors for Predicting Hypertension and Diabetes'. Together they form a unique fingerprint.

Cite this