Water Quality Classification Using K-Nearest Neighbor Algorithm

Gabriella Puteri Ayu Handiaz Mawarti, Eko Hari Rachmawanto

Abstract


Water quality is defined as how well water meets certain standards and criteria for various purposes, such as human consumption, agriculture, industry, and ecosystem preservation. Water quality parameters include various physical, chemical, and biological elements that can affect water properties and safety such as bacteria, mercury, nitrate, nitrite, and aluminum. To classify current and future water quality, machine learning-based classification models such as the K-Nearest Neighbors (KNN) algorithm, were calibrated using historical data and tested on independent datasets to evaluate classification accuracy. The result of this study is to use 20 attributes which are water quality parameters. Calculation of model evaluation using confusion matrix and k= 3,5,7 with split data 70% training data and 30% testing data resulted in an accuracy of 87.83% with a "safe" annotation

Full Text:

PDF

References


M. G. Uddin, S. Nash, A. Rahman, and A. I. Olbert, “Performance analysis of the water quality index model for predicting water state using machine learning techniques,” Process Safety and Environmental Protection, vol. 169, pp. 808–828, Jan. 2023, doi: 10.1016/j.psep.2022.11.073.

M. G. Uddin, S. Nash, M. T. Mahammad Diganta, A. Rahman, and A. I. Olbert, “Robust machine learning algorithms for predicting coastal water quality index,” J Environ Manage, vol. 321, Nov. 2022, doi: 10.1016/j.jenvman.2022.115923.

N. Nasir et al., “Water quality classification using machine learning algorithms,” Journal of Water Process Engineering, vol. 48, p. 102920, Aug. 2022, doi: 10.1016/j.jwpe.2022.102920.

M. Hmoud Al-Adhaileh and F. Waselallah Alsaade, “Modelling and Prediction of Water Quality by Using Artificial Intelligence,” Sustainability, vol. 13, no. 8, p. 4259, Apr. 2021, doi: 10.3390/su13084259.

H. Tahraoui et al., “Advancing Water Quality Research: K-Nearest Neighbor Coupled with the Improved Grey Wolf Optimizer Algorithm Model Unveils New Possibilities for Dry Residue Prediction,” Water (Basel), vol. 15, no. 14, p. 2631, Jul. 2023, doi: 10.3390/w15142631.

A. Danades, D. Pratama, D. Anggraini, and D. Anggriani, “Comparison of accuracy level K-Nearest Neighbor algorithm and Support Vector Machine algorithm in classification water quality status,” in 2016 6th International Conference on System Engineering and Technology (ICSET), IEEE, Oct. 2016, pp. 137–141. doi: 10.1109/ICSEngT.2016.7849638.

B. Aslam, A. Maqsoom, A. H. Cheema, F. Ullah, A. Alharbi, and M. Imran, “Water Quality Management Using Hybrid Machine Learning and Data Mining Algorithms: An Indexing Approach,” IEEE Access, vol. 10, pp. 119692–119705, 2022, doi: 10.1109/ACCESS.2022.3221430.

A. Juna et al., “Water Quality Prediction Using KNN Imputer and Multilayer Perceptron,” Water (Basel), vol. 14, no. 17, p. 2592, Aug. 2022, doi: 10.3390/w14172592.

X. Jia, “Detecting Water Quality Using KNN, Bayesian and Decision Tree,” in 2022 Asia Conference on Algorithms, Computing and Machine Learning (CACML), IEEE, Mar. 2022, pp. 323–327. doi: 10.1109/CACML55074.2022.00061.

M. Y. Shams, A. M. Elshewey, E.-S. M. El-kenawy, A. Ibrahim, F. M. Talaat, and Z. Tarek, “Water quality prediction using machine learning models based on grid search method,” Multimed Tools Appl, vol. 83, no. 12, pp. 35307–35334, Sep. 2023, doi: 10.1007/s11042-023-16737-4.

Y. Li et al., “CART and PSO+KNN algorithms to estimate the impact of water level change on water quality in Poyang Lake, China,” Arabian Journal of Geosciences, vol. 12, no. 9, May 2019, doi: 10.1007/s12517-019-4350-z.

L. Dong, X. Zuo, and Y. Xiong, “Prediction of hydrological and water quality data based on granular-ball rough set and k-nearest neighbor analysis,” PLoS One, vol. 19, no. 2 February, Feb. 2024, doi: 10.1371/journal.pone.0298664.

X. Guoqiang, Z. Yi, X. Shiyi, H. Miaofen, and Z. Ying, “Multi-Classification Method for Determining Coastal Water Quality based on SVM with Grid Search and KNN,” International Journal of Performability Engineering, vol. 15, no. 10, p. 2618, 2019, doi: 10.23940/ijpe.19.10.p7.26182627.

M. Hamzaoui, M. O.-E. Aoueileyine, and R. Bouallegue, “A Hybrid Method of K-Nearest Neighbors with Decision Tree for Water Quality Classification in Aquaculture,” in Communications in Computer and Information Science, vol. 1864 CCIS, Springer Science and Business Media Deutschland GmbH, 2023, pp. 287–299. doi: 10.1007/978-3-031-41774-0_23.

E. Dritsas and M. Trigka, “Efficient Data-Driven Machine Learning Models for Water Quality Prediction,” Computation, vol. 11, no. 2, p. 16, Jan. 2023, doi: 10.3390/computation11020016.

A. Jha, M. Chowdhury, and A. N. Satpute, “Surface Water Quality Forecasting Using Machine Learning Approach,” in Surface and Groundwater Resources Development and Management in Semi-arid Region: Strategies and Solutions for Sustainable Water Management, 2023, pp. 293–315. doi: 10.1007/978-3-031-29394-8_16.


Refbacks

  • There are currently no refbacks.


Flag Counter

 International Journal of Engineering Computing Advanced Research (IJECAR) (e-ISSN : xxxx-xxxxp-ISSN : xxxx-xxxx) is published by ARCES.

 

This journal is under licensed of Creative Commons Attribution 4.0 International License.

Visitor Stats