Hypertension is a major cause of cardiovascular disease, making early risk prediction essential. According to WHO, hypertension cases are estimated to reach 1.28 billion by 2023. This study aims to optimize the K-Nearest Neighbor (KNN) algorithm for predicting hypertension risk through hyperparameter tuning. Three methods Grid SearchCV, Bayes SearchCV, and Random SearchCV are compared to determine the best parameter configuration. The dataset, obtained from Kaggle, consists of 520 balanced samples (260 positive and 260 negative) with 18 health-related features such as age, gender, blood pressure, cholesterol, glucose, and others. After preprocessing, the KNN model is tuned using each method by testing combinations of neighbors (k), weight types, and distance metrics. Results show Bayes SearchCV achieved the highest accuracy of 92%, outperforming the baseline KNN model, which had 85% accuracy. The ROC AUC score of 0.96191 also indicates excellent classification performance. In conclusion, Bayes SearchCV significantly improves KNN's predictive ability in hypertension risk classification.
Copyrights © 2025