Prediction of Clean Water Quality Using K-Nearest Neighbor (KNN) and Naïve Bayes at PDAM Kupang City
DOI:
https://doi.org/10.59934/jaiea.v5i2.1892Keywords:
PDAM, water quality, K-Nearest Neighbor, Naïve Bayes, data mining.Abstract
Kupang City faces significant challenges in providing clean water due to its dry geographical conditions and extreme climate. Although it has various potential water sources such as watersheds and bore wells, clean water distribution remains suboptimal. This study aims to predict clean water quality using two machine learning algorithms, namely K-Nearest Neighbor (KNN) and Naïve Bayes, based on the Water Quality Dataset which includes parameters such as pH, hardness, total dissolved solids, and turbidity. The process involves data preprocessing, algorithm implementation, and model evaluation using classification metrics. The KNN model achieved an accuracy of 56%, with an F1-score of 0.67 for the “unsafe” class and 0.36 for the “safe” class. Meanwhile, the Naïve Bayes model achieved a higher overall accuracy of 61% but failed to detect the “safe” class, showing a precision and recall of 0.00. Overall, KNN performed more balanced across classes despite its moderate accuracy, while Naïve Bayes was biased toward the majority class. These findings highlight the importance of selecting appropriate algorithms and tuning parameters for water quality prediction. The implementation of predictive models is expected to assist PDAM Kupang in making data-driven decisions to improve clean water management sustainably.
Downloads
References
. Alvian, V., Hidayatullah, D., Nilogiri, A., Azizah, H., & Faruq, A. (2021). Klasifikasi Siswa Berprestasi Menggunakan Metode K-Nearest Neighbor (KNN) Pada SMA Negeri 2 Situbondo Classification Of Achieving Students Using K-Nearest Neighbor (KNN) Method At SMA Negeri 2 Situbondo. Jurnal Smart Teknologi, 1(1), 2774–1702. [internet]. [diakses 24 Oktober 2024]. Tersedia pada : http://jurnal.unmuhjember.ac.id/index.php/JST
. Aruriansyah, S. N., Cherid, A., Santoso, H., & Rochmah, D. A. (2023). Rancang Bangun Lingkungan Pemrograman Python Dengan Metode Chatbot Pada Platform Whatsapp. Bit (Fakultas Teknologi Informasi Universitas Budi Luhur), 20(2), 82. [internet]. [diakses 17 Oktober 2024]. Tersedia pada : https://doi.org/10.36080/bit.v20i2.2511
. Azmi, B. N., Hermawan, A., & Avianto, D. (2022). Analisis Pengaruh PCA Pada Klasifikasi Kualitas Air Menggunakan Algoritma K-Nearest Neighbor dan Logistic Regression. Jurnal Sistem Dan Teknologi Informasi, 7(2), 94–103. [internet]. [diakses 17 Oktober 2024]. Tersedia pada : http://jurnal.unmuhjember.ac.id/index.php/JUSTINDO/article/view/8190%0Ahttp://jurnal.unmuhjember.ac.id/index.php/JUSTINDO/article/download/8190/4143
. Fitriono, D., Wardani, S. A., Al, M. N. B., Ristyawan, A., & Daniati, E. (2024). Perbandingan Metode Algoritma Decission Tree dan K-Nearest Neighbors untuk Memprediksi Kualitas Air yang dapat dikonsumsi. 8, 475–484. [internet]. [diakses 03 November 2024].
. Imandasari, T., Irawan, E., Windarto, A. P., & Wanto, A. (2019). Algoritma Naive Bayes Dalam Klasifikasi Lokasi Pembangunan Sumber Air. Prosiding Seminar Nasional Riset Information Science (SENARIS), 1(September), 750. [internet]. [diakses 18 November 2024]. Tersedia pada : https://doi.org/10.30645/senaris.v1i0.81
. Lado, D. (2019). Dadi Lado, Timuneno and Fanggidae/ JOURNAL OF MANAGEMENT (SME’s) Vol. 10, No.3, 2019, p283-297. 10(3), 283–297. [internet]. [diakses 18 November 2024]. Tersedia pada :
. Mahesh, B. (2020). Machine Learning Algorithms - A Review. International Journal of Science and Research (IJSR), 9(1), 381–386. [internet]. [diakses 18 November 2024]. Tersedia pada : https://doi.org/10.21275/art20203995
. Maulidah, N., Maulidah, M., Supriyadi, R., Nalatissifa, H., Diantika, S., & Fauzi, A. (2024). Prediksi Kualitas Air Menggunakan Metode Random Forest, Decision Tree, Dan Gradient Boosting. Jurnal Khatulistiwa Informatika, 12(1), 1–6. [internet]. [diakses 18 November 2024]. Tersedia pada : https://doi.org/10.31294/jki.v12i1.16004
. Natzir, S. M. (2023). Perbandingan Kinerja Model Pembelajaran Mesin dalam Prediksi Banjir menggunakan KNN, Naive Bayes, dan Random Forest. Jurnal Teknologi Informasi, 14(2), 59–64. [internet]. [diakses 18 November 2024]. Tersedia pada : https://doi.org/10.52972/hoaq.vol14no1.p59-64
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Journal of Artificial Intelligence and Engineering Applications (JAIEA)

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.







