We use a few cookies

Essential cookies keep the library working. With your permission, we'd also like to use analytics to see what's useful and improve the experience. Read our Privacy Policy or Cookie Policy.

Skip to main content
Home/e-Resources/Data Science & Analytics/Penerapan Algoritma K-Nearest Neighbors untuk Klasifikasi Kualitas Air Minum
PeriodicalsData Science & Analytics

Penerapan Algoritma K-Nearest Neighbors untuk Klasifikasi Kualitas Air Minum

Checking your access to this record.

Abstract & Overview

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.

Cite this record

Jansen Jansen, Cariven Tanova, Dariel Dariel, Marciano Marciano, Ade Maulana (2025). Penerapan Algoritma K-Nearest Neighbors untuk Klasifikasi Kualitas Air Minum. JDMIS Journal of Data Mining and Information System, 3(2), 86–93. https://doi.org/10.54259/jdmis.v3i2.4513

Copy in another style

Jansen, J., Tanova, C., Dariel, D., Marciano, M., & Maulana, A. (2025). Penerapan Algoritma K-Nearest Neighbors untuk Klasifikasi Kualitas Air Minum. JDMIS Journal of Data Mining and Information System, 3(2), 86–93. https://doi.org/10.54259/jdmis.v3i2.4513
Author names are used as deposited, so check their order before you submit.

Metadata is harvested from open-access indexes and can be incomplete. Check a citation against the published version before relying on it — see our open access & attribution policy.