Machine Learning-Based Drinking Water Potability Classification Using Artificial Neural Network and Random Forest
Keywords:
Random Forest, Convolutional Neural Network, Air Minum, Pembelajaran Mesin, KlasifikasiAbstract
Drinking water quality is an important factor affecting public health. Accurate water potability classification is essential to ensure safe water consumption. This study aims to compare the performance of Artificial Neural Network (ANN) and Random Forest algorithms for drinking water potability classification using the Water Potability dataset. The dataset consists of 3,276 samples with nine water quality parameters, including pH, hardness, solids, chloramines, sulfate, conductivity, organic carbon, trihalomethanes, and turbidity. Data preprocessing involved missing value handling, normalization using MinMaxScaler, and train-test splitting with 70:30 and 80:20 scenarios. Model performance was evaluated using accuracy, precision, recall, and F1-score metrics. Experimental results show that the 80:20 train-test split produced the best performance for both models. Under this scenario, ANN achieved an accuracy of 0.66, precision of 0.67, recall of 0.88, and F1-score of 0.76, while Random Forest achieved an accuracy of 0.66, precision of 0.66, recall of 0.87, and F1-score of 0.75. The results showed that ANN achieved slightly higher precision, recall, and F1-score values than Random Forest. However, the performance difference between the two models was relatively small, so both models can be considered competitive in classifying drinking water quality.
References
A. K. Verma and S. Prakash, “WATER RESOURCES IN A CHANGING WORLD : SCIENCE , MANAGEMENT AND POLICY Water and Its Impact on Human Health,” pp. 61–63, 2025, doi: 10.5281/zenodo.15183465.
D. R. Tripathi, “Safe Drinking Water-Threats of Pollution to Potable Water For The Community,” J. Surv. Fish. Sci., vol. 10, no. 2, pp. 1854–1858, 2023, doi: 10.53555/g86wes45.
E. R. G. Ramakanth Reddy Tetali, Salomi K, BNV Sai Durga G, Sharon Pushpa P, “Analysis of Water Quality Parameters Across Diverse Sources: Research Article,” J. Pharma Insights Res., vol. 2, no. 3 SE-Articles, pp. 210–216, doi: 10.69613/3jxm7e23.
M. H. Pawar, “Advancements and Challenges in Water Analysis : A Comprehensive Review of Methods and Applications,” 2025.
J. Pandey and S. Verma, “Machine Learning Model for Water Quality Analytics BT - Data Science and Big Data Analytics,” D. Mishra, X. S. Yang, A. Unal, and D. S. Jat, Eds., Singapore: Springer Nature Singapore, 2024, pp. 719–729.
M. V. Subbarao, “Enhancing Water Quality Monitoring : Machine Learning-Based Estimation of Water Quality Index ( WQI ),” vol. 10, no. 4, pp. 189–195, 2025.
D. Chandu and D. B. Bidikar, “Random Forest Based ML Model for Potability of Water,” Int. J. Sci. Res. Eng. Manag., vol. 09, no. 07, pp. 1–9, 2025, doi: 10.55041/ijsrem51665.
D. Hartanti and A. I. Pradana, “Komparasi Algoritma Machine Learning dalam Identifikasi Kualitas Air,” SMARTICS J., vol. 9, no. 1, pp. 1–6, 2023.
I. Binanto, M. R. F. Mali, B. A. D. N, and A. Jaya, “Perbandingan Algoritma Random Forest Dan Artificial Neural Network Untuk Dataset Water Potability,” Jtriste, vol. 11, no. 1, pp. 53–59, 2024, doi: 10.55645/jtriste.v11i1.510.
M. H. Al-Adhaileh and F. W. Alsaade, “Modelling and prediction of water quality by using artificial intelligence,” Sustain., vol. 13, no. 8, pp. 1–18, 2021, doi: 10.3390/su13084259.
I. B. D, P. N. Andono, R. A. Pramunendar, and A. Winarno, “Pendekatan Machine Learning dengan Teknik Stacking untuk Memprediksi Kualitas Air Minum,” vol. 6, no. 4, pp. 2546–2558, 2025, doi: 10.47065/bits.v6i4.7014.
S. Y. Kurniawan, S. Sanjaya, Y. Vitriani, and I. Afrianty, “Klasifikasi Kelayakan Air Minum dengan Backpropagation Neural Network Berbasis Penanganan Missing Value dan Normalisasi,” J. Inf. Syst. Res., vol. 6, no. 1, pp. 76–84, 2024, doi: 10.47065/josh.v6i1.5871.
I. Darmawan, Muhammad Fatchan, and Andri Firmansyah, “Classification of Drinking Water Potability With Artificial Neural Network Algorithm,” Int. J. Integr. Sci. Technol., vol. 2, no. 5, pp. 506–515, 2024, doi: 10.59890/ijist.v2i5.1874.
E. Systems, A. Al-ataby, B. N. Getu, and H. Attia, “Machine Learning-Based Water Quality Prediction,” pp. 1–20, 2026.
F. Bouchraki, S. Hamchaoui, L. L. Ayad, Y. Fetouh, C. Mezhoud, and A. Berreksi, “Water Quality Assessment Using the Random Forest Classification Model,” Water Environ. Res., vol. 97, no. 10, p. e70197, Oct. 2025, doi: https://doi.org/10.1002/wer.70197.
S. M. Alomani, N. I. Alhawiti, and A. Alhakamy, “Prediction of Quality of Water According to a Random Forest Classifier,” Int. J. Adv. Comput. Sci. Appl., vol. 13, no. 6, pp. 892–899, 2022, doi: 10.14569/IJACSA.2022.01306105.
C. T. Tran, “Ensemble Learning Approaches for Classification With High-Dimensional Data,” J. Sci. Tech., vol. 12, no. 01, pp. 83–96, 2023, doi: 10.56651/lqdtu.jst.v12.n1.659.ict.
Y. Febriani, M. L. M. Akhlak, M. Apriniyadi, and A. R. Saleh, “Evaluation of Deep Learning Model Performance for Water Quality Classification: Comparison of CNN, LSTM, and Hybrid CNN-LSTM,” pp. 1–26, 2025, [Online]. Available: https://www.researchgate.net/publication/395878608_Evaluation_of_Deep_Learning_Model_Performance_for_Water_Quality_Classification_Comparison_of_CNN_LSTM_and_Hybrid_CNN-LSTM
Downloads
Published
Issue
Section
License

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Syarat yang harus dipenuhi oleh Penulis sebagai berikut:
- Penulis menyimpan hak cipta dan memberikan jurnal hak penerbitan pertama naskah secara simultan dengan lisensi di bawah Creative Commons Attribution License yang mengizinkan orang lain untuk berbagi pekerjaan dengan sebuah pernyataan kepenulisan pekerjaan dan penerbitan awal di jurnal ini.
- Penulis bisa memasukkan ke dalam penyusunan kontraktual tambahan terpisah untuk distribusi non ekslusif versi kaya terbitan jurnal (contoh: mempostingnya ke repositori institusional atau menerbitkannya dalam sebuah buku), dengan pengakuan penerbitan awalnya di jurnal ini.
- Penulis diizinkan dan didorong untuk mem-posting karya mereka online (contoh: di repositori institusional atau di website mereka) sebelum dan selama proses penyerahan, karena dapat mengarahkan ke pertukaran produktif, seperti halnya sitiran yang lebih awal dan lebih hebat dari karya yang diterbitkan. (Lihat Efek Akses Terbuka).




