# Advancing Water Quality Research: K-Nearest Neighbor Coupled with the Improved Grey Wolf Optimizer Algorithm Model Unveils New Possibilities for Dry Residue Prediction

^{1}

^{2}

^{3}

^{4}

^{5}

^{6}

^{7}

^{8}

^{9}

^{10}

^{*}

## Abstract

**:**

^{2}, R

^{2}

_{ADJ}, RMSE, and EPM, which are reported as 0.9979, 0.9958, 0.9956, 41.2639, and 3.1061, respectively. This study reveals a compelling non-linear correlation between physico-chemical water attributes and the content of dry tailings, indicating the ability to accurately predict dry tailing quantities. By employing the proposed methodology to enhance water quality models, it becomes possible to overcome limitations in water quality management and significantly improve the precision of predictions regarding critical water parameters.

## 1. Introduction

## 2. Materials and Methods

#### 2.1. Database

#### 2.2. Modeling Method

^{2}), adjusted coefficient of determination (R

^{2}

_{adj}), root mean square error (RMSE), and Error Prediction of Model (EPM). The formulas used to calculate these criteria were as follows [26,27,28,29,30,31,32]:

## 3. Results and Discussion

#### 3.1. Factors Affecting Water Quality and Dry Residue

#### 3.2. KNN Model

^{2}, R

^{2}

_{adj}, RMSE, and EPM. The eleven distance metrics used in the KNN model (Euclidean, Chebychev, Minkowski, Mahalanobis, Cosine, Correlation, Spearman, Hamming, Jaccard, Cityblock, and Seuclidean) were optimized alongside their corresponding distance weighting functions (such as equal, inverse, and squared inverse) for each fold. The specific parameters of the metric distance checks, particularly the implementation of Minkowski distance metrics and the neighboring noble, were optimized using the I-GWO algorithm. It is important to note that the number of neighbors has been optimized in the range from 1 to 200, and for the Minkowski distance (cubic), the exponent has been optimized in the range from 2 to 5. For the I-GWO algorithm, the number of iterations was set to 100, while the number of agents was optimized in the range of 30 to 200.

^{2}, R

^{2}

_{adj}, RMSE, and EPM, for the best models on the training data, the validation data, and all data.

^{2}, R

^{2}

_{adj}, RMSE and EPM were calculated for each fold of the cross-validation and for the average of the folds for the training (Train), validation (VAL), and overall (ALL) data.

^{2}, and R

^{2}

_{adj}for the training data are all very high for each fold, which indicates an excellent ability of each optimal model obtained to predict the dry residue values for the training data. The values of RMSE are also low in each fold, indicating that the predictions are on average very close to the true values, and the value of MAE was also low, indicating that the predictions are on average very accurate.

^{2}, and R

^{2}

_{adj}for the validation data are also high in each fold, suggesting that the model has good predictive ability and explains much of the variance in the validation data. The RMSE and EPM values for the validation are higher than those for the training data, but still relatively low compared to the optimal experimental value of dry residue, 3000 mg/L.

^{2}, and R

^{2}

_{adj}values were 0.9958, 0.9916, and 0.9910, respectively. These high values indicate that the optimized model can explain a significant portion of the variance in the training data. The model also showed strong performance on the validation data, with R, R

^{2}, and R

^{2}

_{adj}values of 0.9951, 0.9902, and 0.9877, respectively. These results suggest that the model has good predictive ability and can generalize well to unseen data. The RMSE and EPM values for the training data were 56.0826 and 2.7224, indicating that, on average, the predictions were close to the true values with low error. The RMSE and EPM values for the validation data were 70.2751 and 3.2649, showing that the model’s predictions were slightly less accurate for the validation phase but still within an acceptable range. These values are relatively low compared to the optimal experimental value of dry residue, 3000 mg/L, indicating the model’s effectiveness in predicting dry residue values.

^{2}, and R

^{2}

_{adj}values for the training data were 0.9948, 0.9896, and 0.9888, respectively. The values of R, R

^{2}, and R

^{2}

_{adj}showed similar high values on the validation data, with values of 0.9924, 0.9848, and 0.9809, respectively. The RMSE and EPM values for the training data were 65.8544 and 3.2718, and for the validation data, they were 79.3686 and 4.3136. These values indicate that the model’s predictions were slightly less accurate for the validation phase compared to the training phase, but still relatively low compared to the optimal experimental value of dry residue, 3000 mg/L.

^{2}, and R

^{2}

_{adj}values for the training data were 0.9968, 0.9937, and 0.9932, respectively. For the validation data, the corresponding values were 0.9880, 0.9761, and 0.9700, suggesting that the model’s predictions explained a significant portion of the variance in the validation data. The RMSE and EPM values for the training data were 48.5324 and 2.2022, respectively, and for the validation data were 110.9024 and 5.1410, respectively. These values indicate that the model’s predictions were very close to the true values for the training phase, but slightly higher for the validation phase, while still relatively low compared to the optimal experimental value of dry residue, 3000 mg/L.

^{2}, and R

^{2}

_{adj}values for the training data were 0.9930, 0.9861, and 0.9851, respectively. For the validation data, the corresponding values were 0.9948, 0.9897, and 0.9871, respectively, suggesting that the model’s predictions explained a significant portion of the variance in the validation data. The RMSE and EPM values for the training data were 75.7243 and 3.0832, and for the validation data, they were 63.0681 and 3.8588. These values confirm the model’s ability to provide accurate and consistent predictions, while still being relatively low compared to the optimal experimental value of dry residue, 3000 mg/L.

^{2}, and R

^{2}

_{adj}values were 0.9979, 0.9958, and 0.9956, respectively. The average RMSE and EPM values were 41.2639 and 3.1061, respectively, further indicating the model’s accuracy in predicting dry residue values with low error. These values are considerably lower than the optimal experimental value of dry residue, 3000 mg/L, emphasizing the model’s effectiveness in predicting dry residue values.

^{2}= 0.9958, and R

^{2}

_{adj}= 0.9956) as well as low statistical errors (RMSE = 41.2639 and EPM = 3.1061), indicating a high level of precision in the prediction of the target variable. The results of the KNN_I-GWO model are very promising. The average values of R, R

^{2}, and R

^{2}

_{adj}indicate a strong correlation between the predicted values and the actual values. Moreover, the values of RMSE and EPM are low, indicating that the KNN_I-GWO model is accurate in predicting the values of dry residue and could be a valuable tool for analyzing similar datasets. The best models obtained in each fold and also the average of the models are graphically illustrated in Figure 2.

#### 3.3. Model Performance Test

^{2}, and R

^{2}

_{adj}for each phase. In the training data, the R values range from 0.9930 to 0.9968, indicating strong correlations between the predicted and actual dry residue values. The corresponding R

^{2}values are between 0.9861 and 0.9937, indicating that the model explains a substantial portion of the variance in the training data. Additionally, the R

^{2}

_{adj}values range from 0.9851 to 0.9932, further confirming the model’s ability to capture the underlying relationships in the data while adjusting for the number of predictors.

^{2}values range from 0.9848 to 0.9897, suggesting that the model explains a significant proportion of the variance in the validation data. Similarly, the R

^{2}

_{adj}values range from 0.9809 to 0.9871, indicating a robust performance even after adjusting for the number of predictors.

#### 3.4. Analysis of Model Residuals

## 4. Conclusions

^{2}, R

^{2}

_{adj}, RMSE, and EPM (0.9979, 0.9958, 0.9956, 41.2639, and 3.1061, respectively). Further testing on an independent dataset consistently confirmed the model’s efficiency and accuracy, demonstrating low error values and a strong correlation coefficient. The model’s effectiveness can be attributed to its ability to capture the non-linear relationship between dry residue content and physico-chemical characteristics of water. Additionally, the successful representation of the data played a crucial role in achieving outstanding performance. Interpolation testing further reinforced the model’s efficiency and correlation coefficient. In summary, this study underscores the importance of incorporating the dry residue parameter in water quality modeling and treatment. The proposed KNN_I-GWO model, which integrates the KNN and I-GWO algorithms and undergoes comprehensive statistical analyses, demonstrated exceptional performance in terms of coefficients and statistical errors. Its accurate representation of the non-linear relationship between dry residue content and physico-chemical characteristics of water holds significant potential for accurately predicting and managing water quality and treatment processes. This research provides valuable insights and contributes to the advancement of water resource management.

## Author Contributions

## Funding

## Conflicts of Interest

## References

- Kılıç, Z. The Importance of Water and Conscious Use of Water. Int. J. Hydrol.
**2020**, 4, 239–241. [Google Scholar] [CrossRef] - Deng, W.; Wang, G.; Zhang, X. A Novel Hybrid Water Quality Time Series Prediction Method Based on Cloud Model and Fuzzy Forecasting. Chemom. Intell. Lab. Syst.
**2015**, 149, 39–49. [Google Scholar] [CrossRef] - Hamid, A.; Bhat, S.U.; Jehangir, A. Local Determinants Influencing Stream Water Quality. Appl. Water Sci.
**2020**, 10, 24. [Google Scholar] [CrossRef] [Green Version] - Ding, Y.R.; Cai, Y.J.; Sun, P.D.; Chen, B. The Use of Combined Neural Networks and Genetic Algorithms for Prediction of River Water Quality. J. Appl. Res. Technol.
**2014**, 12, 493–499. [Google Scholar] [CrossRef] - Ho, J.Y.; Afan, H.A.; El-Shafie, A.H.; Koting, S.B.; Mohd, N.S.; Jaafar, W.Z.B.; Lai Sai, H.; Malek, M.A.; Ahmed, A.N.; Mohtar, W.H.M.W.; et al. Towards a Time and Cost Effective Approach to Water Quality Index Class Prediction. J. Hydrol.
**2019**, 575, 148–165. [Google Scholar] [CrossRef] - Tahraoui, H.; Amrane, A.; Belhadj, A.-E.; Zhang, J. Modeling the Organic Matter of Water Using the Decision Tree Coupled with Bootstrap Aggregated and Least-Squares Boosting. Environ. Technol. Innov.
**2022**, 27, 102419. [Google Scholar] [CrossRef] - Tahraoui, H.; Belhadj, A.-E.; Triki, Z.; Boudella, N.R.; Seder, S.; Amrane, A.; Zhang, J.; Moula, N.; Tifoura, A.; Ferhat, R.; et al. Mixed Coagulant-Flocculant Optimization for Pharmaceutical Effluent Pretreatment Using Response Surface Methodology and Gaussian Process Regression. Process Saf. Environ. Prot.
**2022**, 169, 909–927. [Google Scholar] [CrossRef] - Tahraoui, H.; Belhadj, A.-E.; Amrane, A.; Houssein, E.H. Predicting the Concentration of Sulfate Using Machine Learning Methods. Earth Sci. Inform.
**2022**, 15, 1023–1044. [Google Scholar] [CrossRef] - Collivignarelli, M.C.; Abbà, A.; Benigna, I.; Sorlini, S.; Torretta, V. Overview of the Main Disinfection Processes for Wastewater and Drinking Water Treatment Plants. Sustainability
**2017**, 10, 86. [Google Scholar] [CrossRef] [Green Version] - Tahraoui, H.; Belhadj, A.-E.; Hamitouche, A.-E. Prediction of the Bicarbonate Amount in Drinking Water in the Region of Médéa Using Artificial Neural Network Modelling. Kem. U Ind. Časopis Kemičara Kem. Inženjera Hrvat.
**2020**, 69, 595–602. [Google Scholar] [CrossRef] - Tahraoui, H.; Belhadj, A.-E.; Hamitouche, A.-E.; Bouhedda, M.; Amrane, A. Predicting the Concentration of Sulfate (So4 2–) in Drinking Water Using Artificial Neural Networks: A Case Study: Médéa-Algeria. Desalination Water Treat.
**2021**, 217, 181–194. [Google Scholar] [CrossRef] - Rajaee, T.; Khani, S.; Ravansalar, M. Artificial Intelligence-Based Single and Hybrid Models for Prediction of Water Quality in Rivers: A Review. Chemom. Intell. Lab. Syst.
**2020**, 200, 103978. [Google Scholar] [CrossRef] - Hastie, T.; Tibshirani, R.; Friedman, J.H.; Friedman, J.H. The Elements of Statistical Learning: Data Mining, Inference, and Prediction; Springer: Berlin/Heidelberg, Germany, 2009; Volume 2. [Google Scholar]
- Amendolia, S.R.; Cossu, G.; Ganadu, M.L.; Golosio, B.; Masala, G.L.; Mura, G.M. A Comparative Study of K-Nearest Neighbour, Support Vector Machine and Multi-Layer Perceptron for Thalassemia Screening. Chemom. Intell. Lab. Syst.
**2003**, 69, 13–20. [Google Scholar] [CrossRef] - Altman, N.S. An Introduction to Kernel and Nearest-Neighbor Nonparametric Regression. Am. Stat.
**1992**, 46, 175–185. [Google Scholar] - Kotsiantis, S.B.; Zaharakis, I.; Pintelas, P. Supervised Machine Learning: A Review of Classification Techniques. Emerg. Artif. Intell. Appl. Comput. Eng.
**2007**, 160, 3–24. [Google Scholar] - Alpaydin, E. Introduction to Machine Learning; MIT Press: Cambridge, MA, USA, 2020; ISBN 0-262-04379-3. [Google Scholar]
- Zamouche, M.; Chermat, M.; Kermiche, Z.; Tahraoui, H.; Kebir, M.; Bollinger, J.-C.; Amrane, A.; Mouni, L. Predictive Model Based on K-Nearest Neighbor Coupled with the Gray Wolf Optimizer Algorithm (KNN_GWO) for Estimating the Amount of Phenol Adsorption on Powdered Activated Carbon. Water
**2023**, 15, 493. [Google Scholar] [CrossRef] - Adithiyaa, T.; Chandramohan, D.; Sathish, T. Optimal Prediction of Process Parameters by GWO-KNN in Stirring-Squeeze Casting of AA2219 Reinforced Metal Matrix Composites. Mater. Today Proc.
**2020**, 21, 1000–1007. [Google Scholar] [CrossRef] - Huang, H.; Wang, Q.; He, X.; Wu, Y.; Xu, C. Association between Polyfluoroalkyl Chemical Concentrations and Leucocyte Telomere Length in US Adults. Sci. Total Environ.
**2019**, 653, 547–553. [Google Scholar] [CrossRef] - Uddin, M.G.; Nash, S.; Olbert, A.I. A Review of Water Quality Index Models and Their Use for Assessing Surface Water Quality. Ecol. Indic.
**2021**, 122, 107218. [Google Scholar] [CrossRef] - Rodier, J.; Legube, B.; Merlet, N.; Brunet, R. L’analyse de L’eau-9e éd.: Eaux Naturelles, Eaux Résiduaires, Eau de Mer; Dunod: Malakoff Cedex, France, 2009; ISBN 978-2-10-054179-9. [Google Scholar]
- Sinha, P.; Sinha, P. Comparative Study of Chronic Kidney Disease Prediction Using KNN and SVM. Int. J. Eng. Res.
**2015**, 4, 608–612. [Google Scholar] [CrossRef] - Ahmed, R.; Rangaiah, G.P.; Mahadzir, S.; Mirjalili, S.; Hassan, M.H.; Kamel, S. Memory, Evolutionary Operator, and Local Search Based Improved Grey Wolf Optimizer with Linear Population Size Reduction Technique. Knowl.-Based Syst.
**2023**, 110297. [Google Scholar] [CrossRef] - Seyyedabbasi, A.; Kiani, F. I-GWO and Ex-GWO: Improved Algorithms of the Grey Wolf Optimizer to Solve Global Optimization Problems. Eng. Comput.
**2021**, 37, 509–532. [Google Scholar] [CrossRef] - Yahoum, M.M.; Toumi, S.; Hentabli, S.; Tahraoui, H.; Lefnaoui, S.; Hadjsadok, A.; Amrane, A.; Kebir, M.; Moula, N.; Assadi, A.A. Experimental Analysis and Neural Network Modeling of the Rheological Behavior of Xanthan Gum and Its Derivatives. Materials
**2023**, 16, 2565. [Google Scholar] [CrossRef] [PubMed] - Belsley, D.A.; Kuh, E.; Welsch, R.E. Regression Diagnostics: Identifying Influential Data and Sources of Collinearity; Wiley: Hoboken, NJ, USA, 1980; ISBN 978-0-471-05856-4. [Google Scholar]
- Hong, S.H.; Lee, M.W.; Lee, D.S.; Park, J.M. Monitoring of Sequencing Batch Reactor for Nitrogen and Phosphorus Removal Using Neural Networks. Biochem. Eng. J.
**2007**, 35, 365–370. [Google Scholar] [CrossRef] - Bousselma, A.; Abdessemed, D.; Tahraoui, H.; Amrane, A. Artificial Intelligence and Mathematical Modelling of the Drying Kinetics of Pre-Treated Whole Apricots. Kem. U Ind.
**2021**, 70, 651–667. [Google Scholar] [CrossRef] - Bouchelkia, N.; Tahraoui, H.; Amrane, A.; Belkacemi, H.; Bollinger, J.-C.; Bouzaza, A.; Zoukel, A.; Zhang, J.; Mouni, L. Jujube Stones Based Highly Efficient Activated Carbon for Methylene Blue Adsorption: Kinetics and Isotherms Modeling, Thermodynamics and Mechanism Study, Optimization via Response Surface Methodology and Machine Learning Approaches. Process. Saf. Environ. Prot.
**2022**, 170, 513–535. [Google Scholar] [CrossRef] - Zamouche, M.; Tahraoui, H.; Laggoun, Z.; Mechati, S.; Chemchmi, R.; Kanjal, M.I.; Amrane, A.; Hadadi, A.; Mouni, L. Optimization and Prediction of Stability of Emulsified Liquid Membrane (ELM): Artificial Neural Network. Processes
**2023**, 11, 364. [Google Scholar] [CrossRef] - Tahraoui, H.; Belhadj, A.-E.; Moula, N.; Bouranene, S.; Amrane, A. Optimisation and Prediction of the Coagulant Dose for the Elimination of Organic Micropollutants Based on Turbidity. Kem. U Ind.
**2021**, 70, 675–691. [Google Scholar] [CrossRef] - Manssouri, I.; Manssouri, M.; El Kihel, B. Fault Detection by K-Nn Algorithm and Mlp Neural Networks in a Distillation Column: Comparative Study. J. Inf. Intell. Knowl.
**2011**, 3, 201. [Google Scholar] - Manssouri, I.; El Hmaidi, A.; Manssouri, T.E.; El Moumni, B. Prediction Levels of Heavy Metals (Zn, Cu and Mn) in Current Holocene Deposits of the Eastern Part of the Mediterranean Moroccan Margin (Alboran Sea). IOSR J. Comput. Eng.
**2014**, 16, 117–123. [Google Scholar] [CrossRef] - Dolling, O.R.; Varas, E.A. Artificial Neural Networks for Streamflow Prediction. J. Hydraul. Res.
**2002**, 40, 547–554. [Google Scholar] [CrossRef] - Post, G.B.; Atherholt, T.B.; Cohn, P.D. Water quality and treatment: A handbook on drinking water. In Health and Aesthetic Aspects of Drinking Water, 6th ed.; McGraw-Hill: New York, NY, USA, 2011; pp. 2.1–2.100. [Google Scholar]
- Boyd, C.E. Water Quality: An Introduction; Springer Nature: Berlin/Heidelberg, Germany, 2019; ISBN 3-030-23335-9. [Google Scholar]
- Bartram, J.; Ballance, R. Water Quality Monitoring: A Practical Guide to the Design and Implementation of Freshwater Quality Studies and Monitoring Programmes; CRC Press: Boca Raton, FL, USA, 1996; ISBN 0-419-22320-7. [Google Scholar]
- WHO. Guidelines for Drinking-Water Quality; World Health Organization: Geneva, Switzerland, 2004; Volume 1, ISBN 92-4-154638-7. [Google Scholar]
- Staff, A. Water Quality: Principles and Practices of Water Supply Operations; American Water Works Assoc.: Denver, CO, USA, 2003. [Google Scholar]
- Csuros, M.; Csuros, C. Environmental Sampling and Analysis for Metals; CRC Press: Boca Raton, FL, USA, 2016; ISBN 1-4200-3234-8. [Google Scholar]
- Rice, E.W.; Bridgewater, L.; Association, A.P.H. Standard Methods for the Examination of Water and Wastewater; American Public Health Association: Washington, DC, USA, 2012; Volume 10. [Google Scholar]
- Nollet, L.M.; De Gelder, L.S. Handbook of Water Analysis; CRC Press: Boca Raton, FL, USA, 2000; ISBN 0-8493-8486-9. [Google Scholar]
- Graindorge, J.; Landot, É. La Qualité de L’eau Potable: Techniques et Responsabilités; Territorial éditions; Territorial: Voiron, France, 2018; ISBN 2-8186-1418-X. [Google Scholar]
- Debieche, T.H. Evolution de La Qualité Des Eaux (Salinité, Azote et Métaux Lourds) Sous L’effet de la Pollution Saline, Agricole et Industrielle: Application à la Basse Plaine de la Seybouse Nord-Est Algérien; University of Franche-Comté: Besançon, France, 2002. [Google Scholar]
- Bishop, C.M.; Nasrabadi, N.M. Pattern Recognition and Machine Learning; Springer: Berlin/Heidelberg, Germany, 2006; Volume 4. [Google Scholar]
- Murphy, K.P. Machine Learning: A Probabilistic Perspective; MIT Press: Cambridge, MA, USA, 2012; ISBN 0-262-30432-5. [Google Scholar]

**Figure 2.**Comparison between experimental and predicted values: (

**a**) 1st fold, (

**b**) 2nd fold, (

**c**) 3rd fold, (

**d**) 4th fold, and (

**e**) the average of the models in the 4 folds.

**Figure 4.**Experimental and predicted values for the modeling samples (samples 1 to 400) and testing samples (samples 401 to 454).

Variables | Symbol | Unit | Min | Mean | Max | STD |
---|---|---|---|---|---|---|

Inputs | ||||||

Conductivity | X_{1} | µS/cm | 223 | 1263.98 | 3570 | 754.59 |

Turbidity | X_{2} | NTU | 0.10 | 7.87 | 1024 | 58.57 |

Potential hydrogen | X_{3} | – | 2.10 | 9.62 | 797 | 37.07 |

Hardness | X_{4} | mg/L | 8.13 | 53.42 | 160 | 24.27 |

Calcium | X_{5} | mg/L | 16.03 | 121.87 | 360.72 | 47.40 |

Magnesium | X_{6} | mg/L | 0 | 55.20 | 218.70 | 36.91 |

Total alkalimetric titre | X_{7} | °F | 6.50 | 117.71 | 663 | 133.39 |

Bicarbonate | X_{8} | mg/L | 6.74 | 200.11 | 495.20 | 117.01 |

Chlorides | X_{9} | mg/L | 10.50 | 150.76 | 609.39 | 125.91 |

Nitrogen dioxide | X_{10} | mg/L | 0 | 0.01 | 0.50 | 0.07 |

Ammonium | X_{11} | mg/L | 0 | 0.02 | 1.05 | 0.14 |

Nitrates | X_{12} | mg/L | 0 | 8.13 | 195.09 | 15.89 |

Phosphate | X_{13} | mg/L | 0 | 1.28 | 288 | 19.09 |

Sulfate | X_{14} | mg/L | 10.55 | 342.25 | 1457 | 287.37 |

Sodium | X_{15} | mg/L | 0 | 122.05 | 460 | 121.67 |

Potassium | X_{16} | mg/L | 0.005 | 6.92 | 805 | 37.92 |

Manganese | X_{17} | mg/L | 0 | 0.007 | 0.21 | 0.02 |

Iron | X_{18} | mg/L | 0 | 0.013 | 0.53 | 0.03 |

Aluminum | X_{19} | mg/L | 0 | 0.005 | 0.90 | 0.04 |

Organic matter | X_{20} | mg/L | 0 | 3.26 | 29.20 | 3.86 |

Output | ||||||

Dry residue | Y | mg/L | 29 | 916.01 | 2980 | 635.64 |

Number of Neighbors | R/R^{2}/R^{2}_{adj} | RMSE/EPM | ||||
---|---|---|---|---|---|---|

Train | VAL | ALL | Train | VAL | ALL | |

1st fold | ||||||

3 | 0.9958 | 0.9951 | 0.9956 | 56.0000 | 70.2000 | 59.9000 |

0.9916 | 0.9902 | 0.9911 | 2.7000 | 3.2000 | 2.8000 | |

0.9910 | 0.9877 | 0.9907 | ||||

2nd fold | ||||||

5 | 0.9948 | 0.9924 | 0.9941 | 65.8000 | 79.3000 | 69.4000 |

0.9896 | 0.9848 | 0.9882 | 3.2000 | 4.3000 | 3.5000 | |

0.9888 | 0.9809 | 0.9876 | ||||

3rd fold | ||||||

6 | 0.9968 | 0.9880 | 0.9940 | 48.5000 | 110.9000 | 69.5000 |

0.9937 | 0.9761 | 0.9881 | 2.2000 | 5.1000 | 2.9000 | |

0.9932 | 0.9700 | 0.9874 | ||||

4th fold | ||||||

7 | 0.9930 | 0.9948 | 0.9935 | 75.7000 | 63.0000 | 72.7000 |

0.9861 | 0.9897 | 0.9869 | 3.0000 | 3.8000 | 3.2000 | |

0.9851 | 0.9871 | 0.9863 | ||||

The average of the folds | ||||||

/ | / | / | 0.9979 | / | / | 41.2000 |

0.9958 | 3.1000 | |||||

0.9956 |

R | R^{2} | R^{2}_{adj} | RMSE | EPM |
---|---|---|---|---|

0.9901 | 0.9804 | 0.9685 | 87.7000 | 9.6000 |

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. |

© 2023 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 (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

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.
https://doi.org/10.3390/w15142631

**AMA Style**

Tahraoui H, Toumi S, Hassein-Bey AH, Bousselma A, Sid ANEH, 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(14):2631.
https://doi.org/10.3390/w15142631

**Chicago/Turabian Style**

Tahraoui, Hichem, Selma Toumi, Amel Hind Hassein-Bey, Abla Bousselma, Asma Nour El Houda Sid, Abd-Elmouneïm Belhadj, Zakaria Triki, Mohammed Kebir, Abdeltif Amrane, Jie Zhang,
and et al. 2023. "Advancing Water Quality Research: K-Nearest Neighbor Coupled with the Improved Grey Wolf Optimizer Algorithm Model Unveils New Possibilities for Dry Residue Prediction" *Water* 15, no. 14: 2631.
https://doi.org/10.3390/w15142631