Web-Based Diabetes Risk Prediction System Using K-NN on Kaggle Early Stage Diabetes Dataset - Ruziq, Fahmi; Wayahdi, M. Rhifky (Jurnal Teknik Informatika (Jutif), 2025)
Diabetes mellitus affects approximately 537 million adults globally, and its rising prevalence poses serious health and economic burdens. Early detection is crucial to reduce risks of complications and improve patient outcomes. This study aims to design and implement a web-based diabetes risk prediction system using the K-Nearest Neighbors (K-NN) algorithm to support early detection based on symptoms. The system utilizes the Kaggle Early Stage Diabetes Risk Prediction Dataset containing 520 records with 17 symptom attributes and one class label. Data preprocessing includes converting categorical data into numerical values, discretizing age into predefined ranges, and applying min-max scaling to normalize feature values. K-NN classification was conducted with K values of 1, 3, and 5, using the PHP Machine Learning (PHP-ML) library and MySQL database integration. The system achieved its highest accuracy of 93.46% at K = 1. Manual testing confirmed that the system processes symptom inputs correctly and provides predictions consistent with training data. This web-based tool offers an accessible platform for early diabetes risk screening, supporting self-assessment and triage. It demonstrates that PHP-ML can effectively implement machine learning in a web environment and can be further enhanced through parameter optimization and integration with larger, more diverse datasets to strengthen generalization.