Machine Learning-Based Prediction of Irrigation Water Quality Index with SHAP Interpretability: Application to Groundwater Resources in the Semi-Arid Region, Algeria
Abstract
1. Introduction
- Conduct comprehensive hydrochemical characterization and calculate irrigation suitability indices (SAR, RSC, MH, PI, KR, SSP, Na%) alongside IWQI for 191 groundwater samples collected across the Ain Oussera Plain during November 2023 to September 2024.
- Generate spatial distribution maps of water quality parameters and indices using GIS-based Inverse Distance Weighting (IDW) interpolation in ArcGIS.
- Develop, optimize, and compare five machine learning models, Support Vector Regression, K-Nearest Neighbors, Random Forest, Gradient Boosting, and XGBoost, for IWQI prediction from water quality parameters.
- Apply multidimensional SHAP analysis to interpret model predictions, quantify feature importance, and identify principal hydrochemical determinants of irrigation water quality.
- Provide actionable evidence-based recommendations for sustainable groundwater management and agricultural planning in the Ain Oussera Plain based on integrated hydrochemical–ML–SHAP–GIS insights.
2. Literature Review
2.1. Irrigation Water Quality Assessment and the IWQI Framework
2.2. Machine Learning Applications in Groundwater Quality Prediction
2.3. Explainable AI and SHAP for Water Quality Model Interpretation
2.4. Research Gap
3. Materials and Methods
3.1. The Description of the Study Area
3.2. Data Collection and Description
3.3. Suitability Indices for Irrigation
3.4. Irrigation Water Quality Index (IWQI)
3.5. Data Preprocessing
3.6. Geospatial Analysis
3.7. Violin and Box Plot Visualization Methods
3.8. Feature Selection
3.8.1. Correlation Analysis
3.8.2. Recursive Feature Elimination with Cross-Validation (RFECV)
3.9. Machine Learning Model
3.9.1. Support Vector Regression (SVR)
- C: controls penalty for large errors
- : width of tolerance zone
- : slack variables for errors outside the
3.9.2. Random Forests
3.9.3. K-Nearest Neighbours (KNN) Algorithm
3.9.4. Gradient Boosting
3.9.5. Extreme Gradient Boosting
3.10. Model Evaluation
3.11. SHAP (Shapley Additive Explanations)
- N: set of all features
- S: any subset of features not containing feature i
- f(S): model prediction when only feature in S are included
- f(): prediction when adding I to the subset
- : contribution of feature i

4. Results and Discussion
4.1. Statistical Summary of Physicochemical Parameters
4.2. Correlation Analysis and Hydrochemical Relationships
4.3. Irrigation Water Quality Index Assessments
4.3.1. Electrical Conductivity (EC)
4.3.2. Sodium Adsorption Ratio (SAR)
4.3.3. Sodium Percentage (Na%)
4.3.4. Residual Sodium Carbonate (RSC)
4.3.5. Permeability Index (PI)
4.3.6. Magnesium Hazard (MH)
4.3.7. Soluble Sodium Percentage (SSP)
4.3.8. Kelly’s Ratio (KR)
4.4. Irrigation Water Quality Index (IWQI) Assessment
4.5. Machine Learning Algorithm Construction and Hyperparameter Tuning
4.6. Feature Selection and Variable Importance
4.7. Machine Learning Model Performance and Comparative Evaluation
4.8. Model Interpretability via SHAP Analysis
4.9. Discussion
5. Limitations and Future Directions
6. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
References
- Jasechko, S.; Seybold, H.; Perrone, D.; Fan, Y.; Shamsudduha, M.; Taylor, R.G.; Fallatah, O.; Kirchner, J.W. Rapid Groundwater Decline and Some Cases of Recovery in Aquifers Globally. Nature 2024, 625, 715–721. [Google Scholar] [CrossRef]
- Ayers, R.S.; Westcot, D.W. Water Quality for Agriculture Irrigation and Drainage; Food and Agriculture Organization of the United Nations: Rome, Italy, 1985; Volume 29, ISBN 92-5-102263-1. [Google Scholar]
- Yadav, P.; Sreekesh, S.; Nandimandalam, J.R. Groundwater Quality and Its Suitability in the Semi-Arid River Basin in India: An Analysis of Hydrogeochemical Processes Using Multivariate Statistics. Environ. Model. Assess. 2025, 30, 625–646. [Google Scholar] [CrossRef]
- Meireles, A.C.M.; de Andrade, E.M.; Chaves, L.C.G.; Frischkorn, H.; Crisostomo, L.A. A New Proposal of the Classification of Irrigation Water. Rev. Ciência Agron. 2010, 41, 349–357. [Google Scholar] [CrossRef]
- Imneisi, I.B. Using The Irrigation Water Quality Index to Evaluate of Some Water Resources in Al-Abyar-Ghut Al-Sultan Area NE Libya. Sci. J. Univ. Benghazi 2021, 34, 6. [Google Scholar] [CrossRef]
- Al-Saadi, R.J.M.; Aziz Mutasher, A.K.; Al-Awadi, A.T. New Regression Model for Estimating Irrigation Water Quality Index. Int. J. Des. Nat. Ecodyn. 2021, 16, 127–134. [Google Scholar] [CrossRef]
- Oleiwi, I.A.M.; Saloom, H.S. Evaluation of Irrigation Water Quality Index (Iwqi) for Main Iraqi Rivers (Tigris, Euphrates, Shatt Al-Arab and Diyala). Iraqi J. Agric. Sci. 2017, 48, 1010–1020. [Google Scholar] [CrossRef]
- De Souza, C.A.; Araujo, Y.R.; de Araujo Neto, J.R.; de Queiroz Palácio, H.A.; Barros, B.E.A. Analise Comparativa da Qualidade de Água para Irrigação em Três Sistemas Hídricos Conectados no Semiárido. Rev. Bras. Agric. Irrig. Rbai 2017, 10, 1011–1022. [Google Scholar] [CrossRef][Green Version]
- Dash, S.; Kalamdhad, A.S. Hydrochemical Dynamics of Water Quality for Irrigation Use and Introducing a New Water Quality Index Incorporating Multivariate Statistics. Environ. Earth Sci. 2021, 80, 1–21. [Google Scholar] [CrossRef]
- Gad, M.; Saleh, A.H.; Hussein, H.; Elsayed, S.; Farouk, M. Water Quality Evaluation and Prediction Using Irrigation Indices, Artificial Neural Networks, and Partial Least Square Regression Models for the Nile River, Egypt. Water 2023, 15, 2244. [Google Scholar] [CrossRef]
- Elsayed, S.; Hussein, H.; Moghanm, F.S.; Khedher, K.M.; Eid, E.M.; Gad, M. Application of Irrigation Water Quality Indices and Multivariate Statistical Techniques for Surface Water Quality Assessments in the Northern Nile Delta, Egypt. Water 2020, 12, 3300. [Google Scholar] [CrossRef]
- Adeyeye, J.A.; Omotoso, T.; Oloruntade, A.J.; Otugboyega, J. GIS-Based Assessment of Irrigation Water Quality Index in Selected Farm Areas, South-Western, Nigeria. FUOYE J. Eng. Technol. 2023, 8, 377–382. [Google Scholar] [CrossRef]
- Breiman, L. Random Forests. Mach. Learn. 2001, 45, 5–32. [Google Scholar] [CrossRef]
- Friedman, J.H. Greedy Function Approximation: A Gradient Boosting Machine. Ann. Stat. 2001, 29, 1189–1232. [Google Scholar] [CrossRef]
- Chen, T.; Guestrin, C. XGBoost: A Scalable Tree Boosting System. In Proceedings of the ACM SIGKDD International Conference on Knowledge Discovery and Data Mining 2016, San Francisco, CA, USA, 13–17 August 2016; ACM: New York, NY, USA, 2016; pp. 785–794. [Google Scholar] [CrossRef]
- Maheswara Rao, V.V.R.; Silpa, N.; Reddy, S.S.; Bonthu, S.; Rao Kurada, R.; Vaishalini, V. An Optimized Ensemble Machine Learning Framework for Water Quality Assessment System by Leveraging Forward Sequential Minimum Redundancy Maximum Relevance Feature Selection Method. In Proceedings of the 2023 International Conference on Innovative Computing, Intelligent Communication and Smart Electrical Systems, ICSES 2023, Chennai, India, 14–15 December 2023; IEEE: New York, NY, USA, 2024; pp. 1–8. [Google Scholar] [CrossRef]
- Dandekar, P.; Thakre, V.; Sharma, K.; Kushwaha, A. A Predictive Model for Water Quality Index Assessment by Machine Learning Approach. In 2024 2nd International Conference on Computer, Communication and Control (IC4 2024), Indore, India, 8–10 February 2024; IEEE: New York, NY, USA, 2024; pp. 1–6. [Google Scholar] [CrossRef]
- Rogers, O.N., III; Ambili, P.S. Water Quality Prediction with Machine Learning Algorithms. EPRA Int. J. Multidiscip. Res. 2024, 10, 1. [Google Scholar] [CrossRef]
- Kuthe, A.; Bhake, C.; Bhoyar, V.; Yenurkar, A.; Khandekar, V.; Gawale, K. Water Quality Prediction Using Machine Learning. Int. J. Comput. Sci. Mob. Comput. 2023, 12, 52–59. [Google Scholar] [CrossRef]
- Muñoz-Alegría, J.A.; Núñez, J.; Oyarzún, R.; Chávez, C.A.; Arumí, J.L.; Rodríguez-López, L.A. Bibliometric-Systematic Literature Review (B-SLR) of Machine Learning-Based Water Quality Prediction: Current State and Projections. Preprints.org. 2025. [Google Scholar] [CrossRef]
- Yan, X.; Zhang, T.; Du, W.; Meng, Q.; Xu, X.; Zhao, X. A Comprehensive Review of Machine Learning for Water Quality Prediction over the Past Five Years. J. Mar. Sci. Eng. 2024, 12, 159. [Google Scholar] [CrossRef]
- Arabgol, R.; Sartaj, M.; Asghari, K. Predicting Nitrate Concentration and Its Spatial Distribution in Groundwater Resources Using Support Vector Machines (SVMs) Model. Environ. Model. Assess. 2015, 21, 71–82. [Google Scholar] [CrossRef]
- Perović, M.; Šenk, I.; Tarjan, L.; Obradović, V.; Dimkić, M. Machine Learning Models for Predicting the Ammonium Concentration in Alluvial Groundwaters. Environ. Model. Assess. 2020, 26, 187–203. [Google Scholar] [CrossRef]
- Makumbura, R.K.; Mampitiya, L.; Rathnayake, N.; Meddage, D.P.P.; Henna, S.; Dang, T.L.; Hoshino, Y.; Rathnayake, U. Advancing Water Quality Assessment and Prediction Using Machine Learning Models, Coupled with Explainable Artificial Intelligence (XAI) Techniques like Shapley Additive Explanations (SHAP) for Interpreting the Black-Box Nature. Res. Eng. 2024, 23, 102831. [Google Scholar] [CrossRef]
- Yuan, Y.; Zhou, C.; Wu, J.; Deng, F.; Liu, W.; Sun, M.; Li, L. An Interpretable Deep Learning Framework for River Water Quality Prediction—A Case Study of the Poyang Lake Basin. Water 2025, 17, 2496. [Google Scholar] [CrossRef]
- Lundberg, S.M.; Lee, S.-I. A Unified Approach to Interpreting Model Predictions. arXiv 2017, arXiv:1705.07874. [Google Scholar] [CrossRef]
- Choudhary, R.; Kumar, A.; C, P.; Naik, M.M.; Choudhury, M.; Khan, N.A. Predicting Water Quality Index Using Stacked Ensemble Regression and SHAP Based Explainable Artificial Intelligence. Sci. Rep. 2025, 15, 31139. [Google Scholar] [CrossRef] [PubMed]
- Wu, J.; Wang, Z.; Dong, J.; Yao, Z.; Chen, X.; Fan, H. Multi-Step Ahead Dissolved Oxygen Concentration Prediction Based on Knowledge Guided Ensemble Learning and Explainable Artificial Intelligence. J. Hydrol. 2024, 636, 131297. [Google Scholar] [CrossRef]
- Li, W.; Deng, M.; Liu, C.; Cao, Q. Analysis of Key Influencing Factors of Water Quality in Tai Lake Basin Based on XGBoost-SHAP. Water 2025, 17, 1619. [Google Scholar] [CrossRef]
- Aderemi, I.A.; Kehinde, T.O.; Daniel Okwor, U.; Ahmad, K.H.; Adjei, K.Y.; Cyriacus Ekechi, C. Explainable AI for Water Quality Monitoring: A Systematic Review of Transparency, Interpretability, and Trust. IEEE Sens. Rev. 2025, 2, 419–443. [Google Scholar] [CrossRef]
- Kulaklıoğlu, D. Explainable AI: Enhancing Interpretability of Machine Learning Models. Hum. Comput. Interact. 2024, 8, 91. [Google Scholar] [CrossRef]
- Maoui, A.; Kherici, N.; Derradji, F. Hydrochemistry of an Albian Sandstone Aquifer in a Semi Arid Region, Ain Oussera, Algeria. Environ. Earth Sci. 2010, 60, 689–701. [Google Scholar] [CrossRef]
- Azlaoui, M.; Nezli, I.E.; Foufou, A.; Haied, N. Hydrodynamic Modeling of the Albian Aquifer of the Plain of Ain Oussera (Semi-Arid Area, Algeria). Energy Procedia 2017, 119, 242–255. [Google Scholar] [CrossRef]
- Haied, N.; Khadri, S.; Foufou, A.; Azlaoui, M.; Chaab, S.; Bougherira, N. Assessment of Groundwater Pollution Vulnerability, Hazard and Risk in a Semi-Arid Region. J. Ecol. Eng. 2021, 22, 1–13. [Google Scholar] [CrossRef]
- Ali Rahmani, S.E.; Chibane, B.; Boucefiène, A. Groundwater Recharge Estimation in Semi-Arid Zone: A Study Case from the Region of Djelfa (Algeria). Appl. Water Sci. 2016, 7, 2255–2265. [Google Scholar] [CrossRef]
- Brahmi, S.; Rahmani, B.; Nesrat, A.; Djamal, C.; Brahmi, S. Assessment of Groundwater Mineralization in the Arid Steppe Region of the Messaad Plateau Aquifer, Southern Algeria. Geomat. Landmanag. Landsc. 2024, 2024, 101–116. [Google Scholar] [CrossRef]
- Azlaoui, M.; Nezli, I.E.; Djelita, B.; Boutoutaou, D. Contribution to the Hydrodynamic Modeling of Groundwater in the Ain El Bel Syncline Wilaya of Djelfa (Algeria). AIP Conf. Proc. 2017, 1814, 020044. [Google Scholar] [CrossRef]
- Ali Rahmani, S.E.; Chibane, B. Geochemical Assessment of Groundwater in Semiarid Area, Case Study of the Multilayer Aquifer in Djelfa, Algeria. Appl. Water Sci. 2022, 12, 1–14. [Google Scholar] [CrossRef]
- Bouteldjaoui, F.; Bessenasse, M.; Taupin, J.-D.; Kettab, A. Mineralization mechanisms of groundwater in a semi-arid area in Algeria: Statistical and hydrogeochemical approaches. J. Water Supply Res. Technol.-Aqua 2020, 69, 173–183. [Google Scholar] [CrossRef]
- Belksier, M.S.; Chaab, S.; Abour, F. Qualité Hydro Chimique des Eaux de La Nappe Superficielle dans La Région de l’Oued Righ et Évaluation de Sa Vulnérabilité à La Pollution. Synthese 2016, 22, 42–57. [Google Scholar]
- Khechana, S.; Derradji, E.F. Qualité Des Eaux Destinées à La Consommation Humaine et à l’Utilisation Agricole: Cas des Eaux Souterraines d’Oued-Souf, Se Algérien. J. Sci. Technol. 2014, 28, 58–68. [Google Scholar] [CrossRef]
- Zegaar, A.; Telli, A.; Ounoki, S.; Shahabi, H. Interpretable Machine Learning Models for Irrigation Sustainability: Groundwater Quality Prediction in M’sila, Algeria. Environ. Model. Assess. 2024, 30, 399–416. [Google Scholar] [CrossRef]
- Hussein, E.E.; Derdour, A.; Zerouali, B.; Almaliki, A.; Wong, Y.J.; Ballesta-de los Santos, M.; Minh Ngoc, P.; Hashim, M.A.; Elbeltagi, A. Groundwater Quality Assessment and Irrigation Water Quality Index Prediction Using Machine Learning Algorithms. Water 2024, 16, 264. [Google Scholar] [CrossRef]
- Gaagai, A.; Aouissi, H.A.; Bencedira, S.; Hinge, G.; Athamena, A.; Haddam, S.; Gad, M.; Elsherbiny, O.; Elsayed, S.; Eid, M.H.; et al. Application of Water Quality Indices, Machine Learning Approaches, and GIS to Identify Groundwater Quality for Irrigation Purposes: A Case Study of Sahara Aquifer, Doucen Plain, Algeria. Water 2023, 15, 289. [Google Scholar] [CrossRef]
- Eid, M.H.; Elbagory, M.; Tamma, A.A.; Gad, M.; Elsayed, S.; Hussein, H.; Moghanm, F.S.; Omara, A.E.D.; Kovács, A.; Péter, S. Evaluation of Groundwater Quality for Irrigation in Deep Aquifers Using Multiple Graphical and Indexing Approaches Supported with Machine Learning Models and GIS Techniques, Souf Valley, Algeria. Water 2023, 15, 182. [Google Scholar] [CrossRef]
- Singh, K.R.; Goswami, A.P.; Kalamdhad, A.S.; Kumar, B. Development of Irrigation Water Quality Index Incorporating Information Entropy. Environ. Dev. Sustain. 2019, 22, 3119–3132. [Google Scholar] [CrossRef]
- Guzman, S.M.; Paz, J.O.; Tagert, M.L.M.; Mercer, A.E. Evaluation of Seasonally Classified Inputs for the Prediction of Daily Groundwater Levels: NARX Networks Vs Support Vector Machines. Environ. Model. Assess. 2018, 24, 223–234. [Google Scholar] [CrossRef]
- He, M.; Qian, Q.; Liu, X.; Zhang, J.; Curry, J. Recent Progress on Surface Water Quality Models Utilizing Machine Learning Techniques. Water 2024, 16, 3616. [Google Scholar] [CrossRef]
- Vijayakumar, A.; Mathai, P.P. Machine Learning and Deep Learning Applications in Groundwater Quality Prediction: A Comprehensive Survey. In Proceedings of the ACCTHPA 2025—Conference on 2025 Advanced Computing and Communication Technologies for High Performance Applications, Cochin, India, 18–19 July 2025; IEEE: New York, NY, USA. [CrossRef]
- Vengatesh, T.; Bhangale, K.B.; Ronicca, M.S.; Gantayat, H.; Viswanathan, R.; Suthar, M.B.; Vanathi, D.; Goyal, S. Explainable AI For Environmental Decision Support: Interpreting Deep Learning Models in Climate Science. Int. J. Environ. Sci. 2025, 11, 1078–1088. [Google Scholar] [CrossRef]
- Arjaria, S.K.; Rathore, A.S.; Badal, S.; Arjaria, S.K.; Rathore, A.S.; Badal, S. Explaining the Importance of Water Quality Parameters for Prediction of the Quality of Water Using SHAP Value. In Artificial Intelligence Applications in Water Treatment and Water Resource Management; IGI Global: Hershey, PA, USA, 2023; pp. 163–181. [Google Scholar] [CrossRef]
- Azlaoui, M.; Zeddouri, A.; Haied, N.; Nezli, I.E.; Foufou, A. Assessment and Mapping of Groundwater Quality for Irrigation and Drinking in a Semi-Arid Area in Algeria. J. Ecol. Eng. 2021, 22, 19–32. [Google Scholar] [CrossRef]
- Houari, I.M.; Bouselsal, B.; Lakhdari, A.S. Evaluating groundwater potability and health risks from nitrates in the semi-arid region of Algeria. Ecol. Eng. Environ. Technol. 2024, 25, 219–233. [Google Scholar] [CrossRef]
- Azlaoui, M.; Karef, S.; Zegait, R.; Haied, N.; Foufou, A.; Nezli, I.E. Hydrochemical Characterization of Groundwater in a Semi-Arid Zone; Algeria. In Proceedings of the 2023 1st International Conference on Renewable Solutions for Ecosystems: Towards a Sustainable Energy Transition, ICRSEtoSET 2023, Djelfa, Algeria, 6–8 May 2023; IEEE: New York, NY, USA, 2024. [Google Scholar] [CrossRef]
- Azlaoui, M.; Karef, S.; Foufou, A.; Haied, N.; Zeddouri, A.; Bengusmia, D. Integration of Land Use/Land Cover Factors with Machine Learning in Groundwater Vulnerability Assessment Models for Semi-Arid Regions Algeria. Desalination Water Treat. 2025, 323, 101256. [Google Scholar] [CrossRef]
- Mebrouk, N.; Blavoux, B.; Issaadi, A. Geochemical and Isotopic Characterization of High-Mg Groundwaters in An Endorheic Basin, Ain Oussera, Algeria. J. Environ. Hydrol. 2007, 15, 1–20. [Google Scholar]
- Richards, L.A. Diagnosis and Improvement of Saline and Alkali Soils. Soil Sci. 1954, 78, 154. [Google Scholar] [CrossRef]
- Wilcox, N. Classification and Use of Irrigation Waters; United States Department of Agriculture: Washington, DC, USA, 1955. [Google Scholar]
- Raghunath, H. Ground Water: Hydrogeology, Ground Water Survey and Pumping Tests, Rural Water Supply and Irrigation Systems; John Wiley and Sons Ltd.: Hoboken, NJ, USA, 1987. [Google Scholar]
- Eaton, F.M. Significance of Carbonates in Irrigation Waters. Soil Sci. 1950, 69, 123–134. [Google Scholar] [CrossRef]
- Todd, N.; Mays, L. Groundwater Hydrology; John Wiley and Sons Ltd.: Hoboken, NJ, USA, 2004. [Google Scholar]
- Doneen, L.D. Notes on Water Quality in Agriculture; Department of Water Science: Davis, CA, USA, 1964. [Google Scholar]
- Kelly, W.P. Permissible Composition and Concentration of Irrigated Waters. Trans. Am. Soc. Civ. Eng. 1941, 106, 849–855. [Google Scholar] [CrossRef]
- M’nassri, S.; El Amri, A.; Nasri, N.; Majdoub, R. Estimation of Irrigation Water Quality Index in a Semi-Arid Environment Using Data-Driven Approach. Water Supply 2022, 22, 5161–5175. [Google Scholar] [CrossRef]
- Foufou, A.; Haied, N.; Azlaoui, M.; Khadri, S.; Boussaid, A.; Kechiched, R. GIS and Index-Based Methods for Assessing the Human Health Risk and Characterizing the Groundwater Quality of a Coastal Aquifer. Ecol. Eng. Environ. Technol. 2023, 24, 36–53. [Google Scholar] [CrossRef]
- Li, J.; Heap, A.D. A Review of Spatial Interpolation Methods for Environmental Scientists; Geoscience Australia: Canberra, Australia, 2008; Volume 6829, ISBN 9781921498305. [Google Scholar]
- Chan, Y.H. Biostatistics 104: Correlational Analysis. Singapore Med. J. 2003, 44, 614–619. [Google Scholar]
- Dancey, C.P.; Reidy, J. Statistics Without Maths for Psychology; Pearson: London, UK, 2017; p. 609. [Google Scholar]
- Granitto, P.M.; Furlanello, C.; Biasioli, F.; Gasperi, F. Recursive Feature Elimination with Random Forest for PTR-MS Analysis of Agroindustrial Products. Chemom. Intell. Lab. Syst. 2006, 83, 83–90. [Google Scholar] [CrossRef]
- Guyon, I.; Weston, J.; Barnhill, S.; Vapnik, V. Gene Selection for Cancer Classification Using Support Vector Machines. Mach. Learn. 2002, 46, 389–422. [Google Scholar] [CrossRef]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Louppe, G.; Prettenhofer, P.; Weiss, R.; et al. Scikit-Learn: Machine Learning in Python. J. Mach. Learn. Res. 2011, 12, 2825−2830. [Google Scholar] [CrossRef]
- Julian, J.; Dewantara, A.B.; Wahyuni, F. Design of Machine Learning-Based Water Quality Prediction System with Recursive Feature Elimination Cross-Validation. J. Infotel 2023, 15, 249–255. [Google Scholar] [CrossRef]
- Vapnik, V.N. The Nature of Statistical Learning Theory, 2nd ed.; Springer Science and Business Media LLC: New York, NY, USA, 2000. [Google Scholar] [CrossRef]
- Mansouri, Z.; Dinar, H.; Belkendil, A.; Bakelli, O.; Drias, T.; Assadi, A.A.; Khezami, L.; Mouni, L. Integrated Groundwater Quality Assessment for Irrigation in the Ras El-Aioun District: Combining IWQI, GIS, and Machine Learning Approaches. Water 2025, 17, 1698. [Google Scholar] [CrossRef]
- Mohseni, U.; Pande, C.B.; Chandra Pal, S.; Alshehri, F. Prediction of Weighted Arithmetic Water Quality Index for Urban Water Quality Using Ensemble Machine Learning Model. Chemosphere 2024, 352, 141393. [Google Scholar] [CrossRef]
- Sihag, P.; Angelaki, A.; Chaplot, B. Estimation of the Recharging Rate of Groundwater Using Random Forest Technique. Appl. Water Sci. 2020, 10, 182. [Google Scholar] [CrossRef]
- Tahraoui, H.; Toumi, S.; Hassein-Bey, A.H.; Bousselma, A.; Sid, A.N.E.H.; Belhadj, A.E.; Triki, Z.; Kebir, M.; Amrane, A.; Zhang, J.; 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 2023, 15, 2631. [Google Scholar] [CrossRef]
- Ortiz-Villaseñor, D.; Trujillo-Hernández, G.; Real-Moreno, O.; Castro-Toscano, M.J.; Medina-Madrazo, L.D.; Barrera-Román, D. K-Nearest Neighbors Regression and Applications. In Exploring Psychology, Social Innovation and Advanced Applications of Machine Learning; IGI Global: Hershey, PA, USA, 2025; pp. 295–316. [Google Scholar] [CrossRef]
- Jeong, J.G.; Ryu, Y.M.; Lee, E.H. Development of XAI-Based Explainable Planning Management for Chl-a Reduction. Water 2025, 18, 7. [Google Scholar] [CrossRef]
- Choubin, B.; Jaafari, A.; Henareh, J.; Karimi, O.; Sajedi Hosseini, F. Explainable Artificial Intelligence (XAI) for Interpreting Predictive Models and Key Variables in Flood Susceptibility. Res. Eng. 2025, 27, 105976. [Google Scholar] [CrossRef]
- Singha, C.; Rana, V.K.; Pham, Q.B.; Nguyen, D.C.; Łupikasza, E. Integrating Machine Learning and Geospatial Data Analysis for Comprehensive Flood Hazard Assessment. Environ. Sci. Pollut. Res. 2024, 31, 48497–48522. [Google Scholar] [CrossRef]
- Subramani, T.; Elango, L.; Damodarasamy, S.R. Groundwater Quality and Its Suitability for Drinking and Agricultural Use in Chithar River Basin, Tamil Nadu, India. Environ. Geol. 2005, 47, 1099–1110. [Google Scholar] [CrossRef]
- Bouteldjaoui, F.; Bessenasse, M.; Kettab, A.; Scheytt, T. Combining Geology, Hydrogeology and Groundwater Flow for the Assessment of Groundwater in the Zahrez Basin, Algeria. Arab. J. Geosci. 2019, 12, 804. [Google Scholar] [CrossRef]
- Ben Alaya, M.; Saidi, S.; Zemni, T.; Zargouni, F.; Alaya, M.B.; Zemni, Á.F.; Zargouni, Á.T.; Saidi, S. Suitability Assessment of Deep Groundwater for Drinking and Irrigation Use in the Djeffara Aquifers (Northern Gabes, South-Eastern Tunisia). Environ. Earth Sci. 2013, 71, 3387–3421. [Google Scholar] [CrossRef]
- Bouteldjaoui, F.; Kettab, A.; Bessenasse, M. Identification of the Hydrogeochemical Process in Zahrez Basin, Algeria. Alger. J. Environ. Sci. Technol. 2017, 3, 64–69. [Google Scholar] [CrossRef]
- Rajmohan, N.; Elango, L. Identification and Evolution of Hydrogeochemical Processes in the Groundwater Environment in an Area of the Palar and Cheyyar River Basins, Southern India. Environ. Geol. 2004, 46, 47–61. [Google Scholar] [CrossRef]
- Lagoun, A.M.; Bouzid-Lagha, S.; Bendjaballah-Lalaoui, N.; Saibi, H. Geographic Information System–Based Approach and Statistical Modeling for Assessing Nitrate Distribution in the Mitidja Aquifer, Northern Algeria. Environ. Monit. Assess. 2021, 193, 631. [Google Scholar] [CrossRef]
- Paliwal, K.V. Irrigation with Saline Water, Monogram No. 2 (New Series); IARI: New Delhi, India, 1972; p. 198. [Google Scholar]















| Parameter | Min | Max | Mean | Std | Skewness | Kurtosis |
|---|---|---|---|---|---|---|
| pH | 6.82 | 8.80 | 7.63 | 0.45 | 0.75 | −0.41 |
| CE (us/cm) | 421.00 | 3800.00 | 1653.77 | 910.45 | 0.90 | −0.31 |
| Ca (mg/L) | 17.00 | 397.70 | 105.41 | 68.61 | 1.48 | 2.29 |
| Mg (mg/L) | 8.00 | 711.70 | 72.83 | 64.04 | 6.05 | 56.19 |
| Na (mg/L) | 17.50 | 906.00 | 128.76 | 121.28 | 3.41 | 16.58 |
| K (mg/L) | 1.50 | 72.00 | 7.85 | 9.12 | 4.25 | 21.49 |
| Cl (mg/L) | 19.97 | 1650.00 | 256.65 | 233.06 | 2.90 | 13.17 |
| SO4 (mg/L) | 7.08 | 2800.00 | 271.36 | 314.48 | 4.02 | 24.81 |
| TH (F) | 14.75 | 351.29 | 56.70 | 37.93 | 3.28 | 20.89 |
| HCO3 (mg/L) | 6.00 | 1418.00 | 229.11 | 141.99 | 4.88 | 33.24 |
| NO3 (mg/L) | 0.01 | 82.60 | 30.31 | 21.46 | 0.74 | −0.48 |
| qi | EC (µs/cm) | Na (meq/L) | Cl (meq/L) | HCO3 (meq/L) | SAR (meq/L)1/2 |
|---|---|---|---|---|---|
| 85–100 | 0.2 ≤ EC < 0.75 | 2 ≤ Na < 3 | 1 ≤ Cl < 4 | 1 ≤ HCO3 < 1.5 | 2 ≤ SAR < 3 |
| 60–85 | 0.75 ≤ EC < 1.50 | 3 ≤ Na < 6 | 4 ≤ Cl < 7 | 1.5 ≤ HCO3 < 4.5 | 3 ≤ SAR < 6 |
| 35–60 | 1.50 ≤ EC < 3.00 | 6 ≤ Na < 12 | 7 ≤ Cl < 10 | 4.5 ≤ HCO3 < 8.5 | 6 ≤ SAR < 12 |
| 0–35 | EC < 0.2 or EC ≥ 3.0 | Na < 2 or Na ≥ 12 | Cl < 1 or Cl ≥ 10 | HCO3 < 1 or HCO3 ≥ 8.5 | SAR < 2 or SAR ≥ 12 |
| Indicator | wi |
|---|---|
| EC | 0.211 |
| Na | 0.204 |
| HCO3 | 0.202 |
| Cl | 0.194 |
| SAR | 0.189 |
| Total | 1.000 |
| IWQI | Water Use Restrictions |
|---|---|
| 0–40 | Severe restriction [SR] |
| 40–55 | High restriction [HR] |
| 55–70 | Moderate restriction [MR] |
| 70–85 | Low restriction [LR] |
| 85–100 | No restriction [NR] |
| Indices | Min | Max | Mean | Std Dev |
|---|---|---|---|---|
| EC | 421.00 | 3800.00 | 1653.77 | 910.45 |
| SAR | 0.62 | 9.83 | 2.75 | 2.13 |
| NA% | 15.85 | 56.06 | 33.91 | 11.10 |
| RSC | −67.40 | −0.88 | −9.94 | 12.46 |
| PI | 27.04 | 59.91 | 46.50 | 9.30 |
| MH | 28.09 | 84.41 | 55.89 | 13.88 |
| SSP | 14.16 | 55.96 | 32.84 | 11.73 |
| KR | 0.16 | 1.27 | 0.53 | 0.28 |
| IWQI | 29.60 | 96.04 | 65.47 | 16.25 |
| Indices | Range | Water Quality | Number of Samples (%) | References |
|---|---|---|---|---|
| EC | <250 250–750 750–2250 2250–5000 >5000 | Excellent Good Permissible Doubtful Unsuitable | 0 (0%) 15 (7.85%) 131 (68.59%) 45 (23.56%) 0 (0%) | [58] |
| SAR | <10 10–18 18–26 >26 | Excellent Good Doubtful Unsuitable | 191 (100%) 0 (0%) 0 (0%) 0 (0%) | [57] |
| RSC | RSC < 1.25 1.25 > RSC < 2.5 RSC > 2.5 | Good Medium Unsuitable | 191 (100%) 0 (0%) 0 (0%) | [60] |
| Na% | <20% 20–40% 40–60% 60–80% >80% | Excellent Good Permissible Doubtful Unsuitable | 28 (14.66%) 121 (63.65%) 42 (21.99%) 0 (0%) 0 (0%) | [58] |
| PI | >75% 25–75% <25% | Suitable Moderate Unsuitable | 2 (1.05%) 182 (95.29%) 7 (3.66%) | [62] |
| MH | <50% >50% | Suitable Unsuitable | 84 (43.98%) 107 (56.02%) | [59] |
| SSP | <50% >50% | Suitable Unsuitable | 182 (95.29%) 9 (4.71%) | [61] |
| KR | <1 >1 | Suitable Unsuitable | 182 (95.29%) 9 (4.71%) | [63] |
| IWQI | 85–100 70–85 55–70 40–55 0–40 | No restriction Low restriction Moderate restriction High restriction Severe restriction | 22 (11.52%) 83 (43.46%) 50 (26.18%) 29 (15.18%) 7 (3.66%) | [4] |
| Model | Optimized Hyperparameters |
|---|---|
| Support Vector Regression (SVR) |
|
| Random Forest Regressor |
|
| Gradient Boosting Regressor |
|
| XGBoost Regressor |
|
| K-Nearest Neighbors (KNN) |
|
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Azlaoui, M.; Karef, S.; Foufou, A.; Haied, N.; Azlaoui, N.; Rabehi, A.; Habib, M.; Zeddouri, A. Machine Learning-Based Prediction of Irrigation Water Quality Index with SHAP Interpretability: Application to Groundwater Resources in the Semi-Arid Region, Algeria. Water 2026, 18, 959. https://doi.org/10.3390/w18080959
Azlaoui M, Karef S, Foufou A, Haied N, Azlaoui N, Rabehi A, Habib M, Zeddouri A. Machine Learning-Based Prediction of Irrigation Water Quality Index with SHAP Interpretability: Application to Groundwater Resources in the Semi-Arid Region, Algeria. Water. 2026; 18(8):959. https://doi.org/10.3390/w18080959
Chicago/Turabian StyleAzlaoui, Mohamed, Salah Karef, Atif Foufou, Nadjib Haied, Nesrine Azlaoui, Abdelaziz Rabehi, Mustapha Habib, and Aziez Zeddouri. 2026. "Machine Learning-Based Prediction of Irrigation Water Quality Index with SHAP Interpretability: Application to Groundwater Resources in the Semi-Arid Region, Algeria" Water 18, no. 8: 959. https://doi.org/10.3390/w18080959
APA StyleAzlaoui, M., Karef, S., Foufou, A., Haied, N., Azlaoui, N., Rabehi, A., Habib, M., & Zeddouri, A. (2026). Machine Learning-Based Prediction of Irrigation Water Quality Index with SHAP Interpretability: Application to Groundwater Resources in the Semi-Arid Region, Algeria. Water, 18(8), 959. https://doi.org/10.3390/w18080959

