doi: 10.18178/ijesd.2025.16.1.1507
Prediction of Water Quality Index (WQI) Using Machine Learning
- 1Faculty of Science and Technology, Suan Sunandha Rajabhat University, Bangkok, Thailand
- 2School of Engineering department, King Mongkut's Institute of Technology Ladkrabang, Bangkok, Thailand
- Manuscript receivedAugust 20, 2024
- revisedOctober 8, 2024
- acceptedOctober 15, 2024
- publishedJanuary 20, 2025
Abstract
The purpose of this project is to assess WaterQuality Index (WQI) by using five machine learning techniquesincluding the Support Vector Machine (SVM), Random Forest(RF), Decision Tree (DF), Extreme Gradient Boosting(XGBoost), and Adaptive Boosting (AdaBoost). In this case, weare using Thailand as a base country for assessing water qualityof the rivers and canals. The data set was collected fromBangkok Metropolitan Authority of Thailand during the periodJanuary 2018 to January 2021. The data set included 43,776records and each record comprised 12 quantitativemeasurements related to water quality. Hence, they were usedas feature inputs of the assessment model; for instance, pH, DO(Dissolved Oxygen), BOD (Biochemical Oxygen Demand), TP(Total Phosphorus), TCB (Total Coloniform Bacteria), FCB(Fecal Coloniform Bacteria), NO3-N (Nitrogen-Nitrogen), No2-N(Nitrogen-Suspended Solid), NH3-N (Ammonia-Nitrogen), TS(Total Solid), and Total Dissolved Solid (TDS). During the phaseof preprocessing K-Nearest Neighbors (KNN) and RandomForest were employed to handle missing data and detectingoutliers. KNN imputation was applied to address missing values,while Random Forest was implemented to eliminate outliers, sogenerating the dataset appropriate for model training. Theeffectiveness of each machine learning model was assessedemploying four principal metrics: accuracy, precision, recall,and F1 score. The findings revealed that all five methodologiesexcelled in predicting WQI; however, the XGBoost modelsurpassed the others, attaining the highest values across allmetrics, including an accuracy of 91%.
Keywords
- water quality index
- machine learning
- data imputation
- SVM
- random forest
- decision tree
- XGBoost
How to Cite
Kunyanuth Kularbphettong, Nareenart Raksuntorn, and Chongrag Boonseng, "Prediction of Water Quality Index (WQI) Using Machine Learning," International Journal of Environmental Science and Development, vol. 16, no. 1, pp. 34-40, 2025. https://doi.org/10.18178/ijesd.2025.16.1.1507
Copyright & License
Copyright © 2025 by the authors. This is an open access article distributed under the Creative Commons Attribution License which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited (CC BY 4.0).
