A CLUSTER-LABEL-BASED FRAMEWORK FOR WATER QUALITY RISK PATTERN CLASSIFICATION USING NAIVE BAYES AND RANDOM FOREST
DOI:
https://doi.org/10.22437/jiituj.v10i3.57126Keywords:
Bengawan Solo, K-Means Clustering, Naive Bayes, Random Forest, Water Quality Risk PatternsAbstract
River water quality monitoring requires an analytical approach that can classify risk patterns from field observations, especially when independent official water quality labels are unavailable. Method: This study classified water quality risk patterns in the Bengawan Solo River using Naive Bayes and Random Forest based on K-Means cluster labels. The initial dataset consisted of 1,753 observations with ten attributes. After feature selection and missing-value removal, 1,751 observations with seven features were used, namely temperature, pH, electrical conductivity, total dissolved solids, water color, odor, and weather condition. K-Means with K=2 generated higher-risk and lower-risk pattern labels, which were then used as classification targets. Results: Naive Bayes achieved an accuracy of 0.988604, precision of 0.988880, recall of 0.988339, and F1-score of 0.988577. Random Forest achieved an accuracy of 0.980057, precision of 0.980499, recall of 0.979655, and F1-score of 0.980004. Discussion: The findings indicate that cluster-derived labels can be recognized consistently by supervised models, while Random Forest feature importance shows that total dissolved solids and electrical conductivity are the most dominant parameters. The results should be interpreted as cluster label based risk pattern classification, not as official pollution status prediction. The novelty of this study lies in integrating cluster-derived labels, supervised classification, and feature-importance analysis for unlabeled water-quality data, while the findings highlight the practical importance of total dissolved solids and electrical conductivity in preliminary water-quality monitoring.
References
Abadi, A. M., & others. (2025). Determining river water quality in the special region of yogyakarta using k-means and fuzzy c-means algorithms. TEM Journal.
Al-Adhaileh, M. H., & Alsaade, F. W. (2021). Modelling and prediction of water quality by using artificial intelligence. Sustainability, 13(8), 4259. https://doi.org/10.3390/su13084259.
Aldrees, A., & others. (2024). Evaluation of water quality indexes with novel machine learning and SHAP-based interpretation. Environmental Research, 238, 118269. https://doi.org/10.1016/j.envres.2024.118269.
Aldrees, R., & others. (2024). Explainable AI for environmental risk modeling. Environmental Informatics.
Choudhary, R., Kumar, A., C., P., Naik, M. M., Choudhury, M., & Khan, N. A. (2025). Predicting water quality index using stacked ensemble regression and shap based explainable artificial intelligence. Scientific Reports, 15, 31139.
del Castillo, A., Yebra-Montes, C., Verduzco Garibay, M., de Anda, J., Garcia-Gonzalez, A., & Gradilla-Hernández, M. S. (2022). Simple prediction of an ecosystem-specific water quality index and the water quality classification of a highly polluted river through supervised machine learning. Water, 14(8), 1235. https://doi.org/10.3390/w14081235.
Dritsas, E., & others. (2023). Efficient data-driven machine learning models for water quality prediction. Computers, 12(2), 16. https://doi.org/10.3390/computers12020016.
Ezzat, D., Soliman, M., Ahmed, E., & Hassanien, A. E. (2023). An optimized explainable artificial intelligence approach for sustainable clean water. Environment, Development and Sustainability, 26(10), 25899–25919. https://doi.org/10.1007/s10668-023-03712-0.
Firdiani, F., Mandala, S., Adiwijaya, & Abdullah, A. H. (2024). WaQuPs: a ros-integrated ensemble learning model for precise water quality prediction. Applied Sciences, 14(1), 262. https://doi.org/10.3390/app14010262.
Gao, M., Yun, Q., Zhang, Q., Liu, Y., & Zhang, Z. (2025). Surface water quality classification and prediction model based on multiple machine learning algorithms. Scientific Reports, 15, 39907. https://doi.org/10.1038/s41598-025-23775-5.
Ghobadi, F., & Kang, D. (2023). Application of machine learning in water resources management: a systematic literature review. Water, 15(4), 620. https://doi.org/10.3390/w15040620.
Hassan, M. M., Hassan, M. M., Akter, L., Rahman, M. M., Zaman, S., Hasib, K. M., Jahan, N., & others. (2021). Efficient prediction of water quality index (WQI) using machine learning algorithms. Human-Centric Intelligent Systems, 1, 86–97.
Hernanda, T., Nugroho, S. S. P., Izzati, T. I., Nisa, F. K., Wahyudin, W. C., & Nuriyatman, E. (2025). Iot-based legal policy in co₂ emission safety control to support green transportation. Jurnal Ilmiah Ilmu Terapan Universitas Jambi, 9(4), 1434–1443. https://doi.org/10.22437/jiituj.v9i4.48755.
Hridoy, M. A. A. M., & others. (2025). Advanced machine learning models for accurate water quality classification and wqi prediction: implications for aquatic disease risk management. Science of the Total Environment, 1008, 180965. https://doi.org/10.1016/j.scitotenv.2025.180965.
Hridoy, Md. A. A. M., Shawkat, A. I., Bordin, C., Acharjee, M. R., Masood, A., Baki, A. O., & Al Mamun, Md. A. (2025). Advanced machine learning models for accurate water quality classification and wqi prediction: implications for aquatic disease risk management. Science of The Total Environment, 1008, 180965. https://doi.org/10.1016/j.scitotenv.2025.180965.
Kapoor, S., & Narayanan, A. (2023). Leakage and the reproducibility crisis in machine-learning-based science. Patterns, 4(9), 100804. https://doi.org/10.1016/j.patter.2023.100804.
Khoi, D. N., Quan, P. T., Linh, D. T., Nhi, N. T. T., & Thuy, N. T. (2022). Using machine learning models for predicting the water quality index in the la buong river, Vietnam. Water, 14(10), 1552. https://doi.org/10.3390/w14101552.
Kristiyowati, L. A. S., Hana, F. M., & Wahyudin, W. C. (2025). Penerapan algoritma naive bayes pada sistem chatbot persewaan kos [Application of the naive Bayes algorithm to a boarding house rental chatbot system]. Sainteks, 22(1), 53–62. https://doi.org/10.30595/sainteks.v22i1.25962.
Lokman, A., Ismail, W. Z. W., & Aziz, N. A. A. (2025). A review of water quality forecasting and classification using machine learning models and statistical analysis. Water, 17(15), 2243. https://doi.org/10.3390/w17152243.
Madni, H. A., Umer, M., & others. (2023). Water-quality prediction based on h2o automl and explainable ai techniques. Water, 15(3), 475.
Makumbura, R. K., Mampitiya, L. I., Rathnayake, N., & Meddage, D. P. P. (2024). Advancing water quality assessment and prediction using machine learning models, coupled with explainable artificial intelligence techniques like shap for interpreting the black-box nature. Results in Engineering, 23, 102831. https://doi.org/10.1016/j.rineng.2024.102831.
Mallick, J., Pandey, S., Alsubih, M., & Singh, R. (2022). Integrated remote sensing and machine learning approach for monitoring and predicting river water quality. Environmental Monitoring and Assessment, 194(10), 1–20. https://doi.org/10.1007/s10661-022-10045-0.
Man, G., Yun, Q., Qilin, Z., Yuyong, L., & Zhuoshi, Z. (2025). Surface water quality classification and prediction model based on multiple machine learning algorithms. Scientific Reports, 15(1). https://doi.org/10.1038/s41598-025-23775-5.
Masood, A., & others. (2023). a machine learning-based framework for water quality index estimation in the southern bug river. Water, 15(20), 3543. https://doi.org/10.3390/w15203543.
Muhammad, M., Sutikno, T., & Riadi, I. (2025). A Comparative study of k-means and knn imputation for handling missing data in scholarship applicant datasets. JUITA: Jurnal Informatika, 13(3). https://doi.org/10.30595/juita.v13i3.26502.
Nallakaruppan, M. K., Gangadevi, E., Shri, M. L., Balusamy, B., Bhattacharya, S., & Selvarajan, S. (2024). Reliable water quality prediction and parametric analysis using explainable ai models. Scientific Reports, 14, 7520. https://doi.org/10.1038/s41598-024-56775-y.
Novianta, M. A., Syafrudin, S., & Warsito, B. (2023). K-Means clustering for grouping rivers in diy based on water quality parameters. JUITA: Jurnal Informatika, 11(1). https://doi.org/10.30595/juita.v11i1.16986.
Ramya, S., & others. (2024). Comprehensive analysis of multiple classifiers for assessment of water quality index. Water-Energy Nexus.
Ridwan, A., Sutikno, T., Riyadi, I., & Wahyudin, W. C. (2025). On-Time student graduation prediction modeling: a comparative analysis of naive bayes algorithm and other data mining classifications. JOINCS (Journal of Informatics, Network, and Computer Science), 8(2).
Sangwan, V., & Bhardwaj, R. (2024). Machine learning framework for predicting water quality classification. Water Practice and Technology, 19(11), 4499–4521. https://doi.org/10.2166/wpt.2024.259.
Schäfer, K., & others. (2022). Machine learning applications for river water quality prediction. Environmental Modelling & Software.
Shamsuddin, I. I. S., & others. (2022). Prediction of water quality classification of the langat river basin, Malaysia, using machine learning. Water, 14(19), 2939. https://doi.org/10.3390/w14192939.
Tran, Y. B., Arias-Rodriguez, L. F., & Huang, J. (2022). Predicting high-frequency nutrient dynamics in the Danube River with surrogate models using sensors and Random Forest. Frontiers in Water, 4, 894548. https://doi.org/10.3389/frwa.2022.894548.
Wahyudin, W. C., Sutikno, T., Umar, R., & Ridwan, A. (2025). Comparison of data mining model performance in heart disease detection with feature selection application. JOINCS (Journal of Informatics, Network, and Computer Science), 8(1), 87–93.
Wala, J., Herman, H., & Umar, R. (2024). Implementasi k-means clustering pada pengelompokan pasien penyakit jantung [Implementation of k-means clustering in grouping heart disease patients]. JISKA (Jurnal Informatika Sunan Kalijaga), 9(3), 205–216. https://doi.org/10.14421/jiska.2024.9.3.205-216.
Wu, J., & Wang, Z. (2022). A hybrid model for water quality prediction based on an artificial neural network, wavelet transform, and long short-term memory. Water, 14(4), 610. https://doi.org/10.3390/w14040610.
Xu, J., Xu, Z., Kuang, J., Lin, C., Xiao, L., Huang, X., & Zhang, Y. (2021). An Alternative to Laboratory Testing: Random Forest-Based Water Quality Prediction Framework for Inland and Nearshore Water Bodies. Water, 13(22), 3262. https://doi.org/10.3390/w13223262.
Yan, X., Zhang, T., Du, W., Meng, Q., Xu, X., & Zhao, X. (2024). A comprehensive review of machine learning for water quality prediction over the past five years. Journal of Marine Science and Engineering, 12(1), 159. https://doi.org/10.3390/jmse12010159.
Yuan, P., Li, H., Yi, X., Wang, J., Ning, C., Xu, X., & Nong, X. (2025). Optimizing water quality index using machine learning: A six-year comparative study in riverine and reservoir systems. Scientific Reports, 15, 33919. https://doi.org/10.1038/s41598-025-10187-8.
Downloads
Published
Issue
Section
License
Copyright (c) 2026 Widya Cholid Wahyudin, Tole Sutikno, Rusydi Umar

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












