Chronic Kidney Disease (CKD) is a progressive disease with an increasing global prevalence and is associated with serious complications, reduced quality of life, and increased mortality when not diagnosed and managed appropriately. This study aimed to develop a K-Nearest Neighbor (KNN)-based model for classifying CKD stages using routine laboratory parameters and to implement the selected model into a web-based prototype. The dataset consists of patient laboratory test records collected from a specialized kidney hospital. The research methodology included data preprocessing, stratified train-test splitting, Synthetic Minority Over-sampling Technique (SMOTE) applied only to the training data, Min-Max normalization, and hyperparameter optimization using GridSearchCV with five-fold cross-validation. The final model was evaluated on an independent testing dataset using a confusion matrix, accuracy, precision, recall, and F1-score. The selected KNN model, using an 80:20 train-test split, achieved an overall testing accuracy of 95.06%, with a weighted precision of 96%, weighted recall of 95%, and weighted F1-score of 95%. These findings indicate that the proposed model was able to classify the five CKD stages with good predictive performance on the internal testing dataset. The selected model was subsequently implemented as a Flask-based web prototype to facilitate CKD stage prediction. Nevertheless, because the evaluation was limited to a single train-test split using data from one hospital, the reported performance should be interpreted as an internal validation result and requires further external validation before clinical implementation.

