Diabetes is one of the chronic diseases that affects millions of people worldwide. Early diagnosis is crucial to prevent long-term complications, but the main challenges lie in the complexity of medical data and selecting optimal parameters for classification algorithms. This research aims to optimize the K-Nearest Neighbors (KNN) algorithm using Bayesian Optimization to improve accuracy in diabetes classification. The dataset used is the "Early-stage Diabetes Risk Prediction" from the UCI Machine Learning Repository, preprocessed through normalization and categorical feature encoding. Bayesian Optimization was applied to find the optimal parameters, such as the number of neighbors (k) and the best distance metric. The results show that the optimized KNN achieved 91.34% accuracy, 100% precision, and a 93.23% F1-Score, demonstrating a significant improvement over the standard KNN model. In conclusion, KNN optimization with Bayesian Optimization proves effective in enhancing diabetes classification performance and can contribute significantly to early detection and disease management.
Copyrights © 2024