Analisis Variabel K Pada Penerapan Metode K-Nearest Neighbors (K-NN) Untuk Klasifikasi Penyakit Demam Tifoid (Tifus)
DOI:
https://doi.org/10.61231/2bpzph26Keywords:
Demam Tifoid, K-Nearest Neighbor, Variabel K, Pendekatan Bayesian, KlasifikasiAbstract
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.
References
A. C. Prihandoko, E. Susanto, and W. R., “Evaluasi Model Klasifikasi Machine Learning untuk Diagnosis Penyakit Berbasis Data Rekam Medis,” J. Inform. J. Pengemb. IT, vol. 9, no. 1, pp. 12–19, 2024.
D. Zahra, A. Nurdin, U. Fitria, K. A. Dinen, and R. Kurnia, “Pemanfaatan Teknologi dalam Bidang Kesehatan Masyarakat,” Public Health J., 2021.
E. Fahmi Ginting, M. Hutasuhut, M. Roza Fitri, and S. Triguna Dharma, “Sistem Cerdas Mendiagnosa Penyakit Demam Tifoid dengan Metode Case Based Reasoning,” J. Sci. Soc. Res., 2023.
Erald Giovanny Hasiholan Simatupang et al., “Epidemiologi dan Resistensi Antibiotik Salmonella typhi dan Paratyphi A pada Kasus Demam Tifoid di Jakarta: A Systematic Literature Review,” J. Ilmu Psikol. dan Kesehat., 2023.
Fanny Ramadhani, Andy Satria, and Indah Purnama Sari, “Implementasi Metode Fuzzy K-Nearest Neighbor dalam Klasifikasi Penyakit Demam Berdarah,” Hello World J. Ilmu Komput., vol. 2, no. 2, pp. 58–62, 2023
F. A. Nishat and I. Mahmud, “Enhancing Typhoid Fever Diagnosis Based on Clinical Data Using a Lightweight Machine Learning Metamodel,” vol. 15, no. 5, 2026.
Gustriansyah, R., Alie, J., Sanmorino, A., Heriansyah, R. and Noor, M.M., 2022. Noor (Machine Learning for Regencies-Cities Clustering Based on Inflation and Poverty Rates in Indonesia) Machine Learning for Regencies-Cities Clustering Based on Inflation and Poverty Rates in Indonesia. Indonesian Journal of Information Systems (IJIS), .
Gustriansyah, R., Suhandi, N., Puspasari, S. and Sanmorino, A., 2024. Machine Learning Method to Predict the Toddlers’ Nutritional Status. JURNAL INFOTEL, 16(1). https://doi.org/10.20895/infotel.v15i4.988.
H. Hafid, “Penerapan K-Fold Cross Validation untuk Menganalisis Kinerja Algoritma K-Nearest Neighbor pada Data Kasus Covid-19 di Indonesia,” J. Math., 2023.
H. Wang, X. Z., and W. Pedrycz, “An Overview on the Roles of Fuzzy Set Techniques in Big Data Processing: Trends, Challenges and Opportunities,” Knowledge-Based Syst., pp. 569–589, 2023.
H. Sarker, “Machine Learning: Algorithms, Real-World Applications and Research Directions,” SN Comput. Sci., vol. 2, no. 3, p. 160, 2021.
Ibrahim Akbar, M., Heriansyah, R., Haviz Irfani, M., Indo Global Mandiri, U., Jend Sudirman Km, J., Jurusan Teknik Informatika, P. and Ilmu Komputer Dan Sains, F., 2026. Pengaruh Splitting Data terhadap Akurasi Klasifikasi Demam Berdarah Dengue Menggunakan K-Nearest Neighbors. Jurnal Algoritme, 6(2), pp.244–256. https://doi.org/10.35957/algoritme.v6i2.13274.
I. Fauzi and H. C., “Analisis Kinerja Algoritma K-Nearest Neighbor dalam Klasifikasi Penyakit Liver,” J. Tek. Inform. UNIKA Santo Thomas, vol. 10, no. 2, pp. 357–364, 2025.
J. F. J. Tobing, “Demam Tifoid,” 2024, doi: 10.37817/ikraith-humaniora.v8i2
M. Y. Matdoan, “Penerapan Metode K-Nearest Neighbor untuk Mengklasifikasi Penyebaran Kasus Demam Berdarah Dengue (DBD) di Kabupaten Maluku Tenggara,” Square J. Math. Math. Educ., vol. 4, no. 2, pp. 75–82, 2022, doi: 10.21580/square.2022.4.2.13056.
Nazori Suhandi, Rendra Gustriansyah and Destria, A., 2025. Klasifikasi Penyakit TBC Menggunakan Metode UMAP dan K-NN. bit-Tech, 7(3), pp.843–852. https://doi.org/10.32877/bt.v7i3.2227.
N. M. Tangkelayuk and E. Mailoa, “Evaluasi Performa Model Klasifikasi Menggunakan Confusion Matrix pada Dataset Penyakit,” J. Tek. Inform. dan Sist. Inf., vol. 8, no. 2, pp. 401–410, 2022.
S. Latuconsina and M. Y. Matdoan, “Prediksi Penyebaran Kasus Demam Berdarah Dengue (DBD) Dengan Metode K-Nearest Neighbor di Kabupaten Maluku Tengah,” J. Ilm. Mat. dan Terap., vol. 19, no. 2, pp. 254–261, 2022.
Suhandi, N., Gustriansyah, R., Destria, A., Amalia, M. and Kris, V., 2024. Prediksi Kualitas Susu Menggunakan Metode K-Nearest Neighbors Milk Quality Prediction Using The K-Nearest Neighbors Method. [online] 14(2). https://doi.org/10.30700/sisfotenika.v14i2.430
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Nanda Nur’Azmi Utami, Rendra Gustriansyah, Nazori Suhandi

This work is licensed under a Creative Commons Attribution 4.0 International License.
You are free to:
- Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
- Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.







