Clinical diagnosis of typhoid fever frequently encounters challenges due to overlapping symptomatic characteristics with other infectious diseases, thereby increasing the risk of misdiagnosis. This study implements the K-Nearest Neighbor (K-NN) algorithm for typhoid fever classification, focusing on optimizing the selection of the K parameter value through a probabilistic Bayesian Likelihood approach. The dataset consists of 203 primary medical records from Dempo Health Center, Palembang, for the 2024–2026 period, with input features comprising fever duration, gastrointestinal symptoms, neurological symptoms, skin manifestations, and Widal test results. Model testing was conducted using a 70:30 data-splitting scheme (142 training data and 61 testing data). Evaluation results from both Bayesian Likelihood and the Elbow Method consistently determined K = 3 as the most optimal nearest-neighbor parameter. The K-NN model with K=3 achieved excellent classification performance, with an Accuracy of 96.72%, a Precision of 100.00%, and a Recall of 89.47%. These results indicate that the model is highly feasible as a clinical decision support system to assist medical personnel in detecting typhoid fever quickly, objectively, and accurately.
Copyrights © 2026