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

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 <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{2 6, 0 8 4}$</tex> 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.

Authors

Institutions

Publication Details

Published
2025-06-28
DOI
https://doi.org/10.1109/icipca65645.2025.11138843
Primary Topic
Artificial Intelligence in Healthcare
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Shupei Qiao
Artificial Intelligence in Healthcare
article

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

Shupei Qiao
article en

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 <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$\mathbf{2 6, 0 8 4}$</tex> 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.

City University of Hong Kong (HK)
Openalex Percentile: Top 73%
Artificial Intelligence in Healthcare
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

A Comparative Study of Random Forest and K-Nearest Neighbors for Predicting Hypertension and Diabetes — Shupei Qiao · (2025) | TGRS Research Map | TGRS