Journal of Data Mining and Information Systems
Vol. 3 No. 2 (2025): August 2025

Penerapan Algoritma K-Nearest Neighbors untuk Klasifikasi Kualitas Air Minum

Jansen, Jansen (Unknown)
Tanova, Cariven (Unknown)
Dariel, Dariel (Unknown)
Marciano, Marciano (Unknown)
Maulana, Ade (Unknown)



Article Info

Publish Date
31 Aug 2025

Abstract

This study aims to classify drinking water potability based on physical and chemical parameters using the K-Nearest Neighbors (KNN) algorithm. The dataset, sourced from the Kaggle platform, contains 100,000 water samples with nine key attributes, including pH, hardness, total dissolved solids (TDS), sulfate, chloramines, conductivity, organic carbon, trihalomethanes, and turbidity. The target label is potability, indicating whether the water is safe (1) or unsafe (0) for consumption. The preprocessing steps included normalization and splitting the data into training and testing sets. The KNN model was trained by experimenting with various K values to achieve optimal performance. Evaluation using a confusion matrix showed that the model achieved an accuracy of 78%. For the potable class, the model reached a precision of 72%, recall of 91%, and F1-score of 81%. For the non-potable class, it achieved a precision of 88%, recall of 65%, and F1-score of 75%. Although the model tends to misclassify unsafe water as safe, overall performance is promising. These findings suggest that the KNN algorithm can serve as an effective classification approach and has potential for application in automated water quality monitoring systems.

Copyrights © 2025






Journal Info

Abbrev

jdmis

Publisher

Subject

Computer Science & IT

Description

Journal of Data Mining and Information Systems (JDMIS) is intended as a medium for scientific studies of research results, thoughts, and critical-analytic studies regarding research in the field of computer science and technology, including Information Technology, Informatics Management, Data ...