Abstract
Accurate assessment of water quality is crucial for protecting public health and promoting environmental sustainability. Conventional laboratory-based methods for evaluating microbial contaminants are often time-consuming, resource-intensive, and reactive in nature, limiting their effectiveness for real-time water quality monitoring and management. This study examines the application of data-driven machine learning models to predict E. coli concentrations in Midmar Dam, utilizing readily available physicochemical parameters. A comparative analysis was conducted using five classical standalone ML algorithms: Random Forest (RF), Support Vector Machine (SVM), k-Nearest Neighbors (kNN), Artificial Neural Network (ANN), and Extreme Gradient Boosting (XGBoost). These models were assessed based on their predictive performance using standard error metrics, including Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE). Among the models evaluated, the kNN algorithm demonstrated superior performance, achieving the lowest MSE and RMSE values, thereby highlighting its effectiveness in capturing the complex relationships between physicochemical indicators and microbial contamination levels. The findings demonstrate the potential of ML-based approaches to serve as efficient, scalable, and proactive tools for sustainable water-quality monitoring and management in dams.
1. Introduction
The presence of E. coli at elevated concentrations in the water systems is a critical indicator of fecal contamination. It represents a significant threat to public health, environmental integrity, and socioeconomic development [1,2]. In many parts of the world, especially in developing regions, communities continue to face challenges in accessing safe and clean water [3].
Microbiological pollution, primarily resulting from human and animal waste, introduces a variety of pathogens, including bacteria and viruses, into water bodies, posing severe health risks [4]. These microorganisms are capable of surviving, reproducing, and dispersing in aquatic environments, which poses a potential risk for widespread waterborne disease outbreaks if not properly controlled [5].
Current methods for E. coli detection are largely reliant on traditional laboratory techniques that involve sample collection, culturing, and incubation. These procedures are labor-intensive and time-consuming, typically requiring at least 12 h before results become available [6]. This delay hampers timely decision-making and increases the risk of exposure to contaminated water, rendering these methods inadequate for real-time monitoring and rapid response applications [7]. Consequently, there is an urgent need for efficient and accurate predictive systems that can rapidly and reliably estimate E. coli concentrations.
Recent advances in artificial intelligence, particularly in deep learning architectures such as convolutional neural networks (CNNs) and Deep Dense Neural Network (DNN), have demonstrated promising capabilities in predicting water quality parameters [8,9,10,11,12,13,14,15,16,17,18,19,20,21]. Gupta et al. [6] applied a convolutional neural network (CNN) to detect E. coli bacteria in water. Solanki et al. [22] proposed an unsupervised learning deep learning model for water quality parameter predictions using data collected from the Chaskaman River. El-Shebli et al. [23] introduced a Deep Neural Network method for WQI prediction in both dry and wet seasons. However, these approaches are often data-intensive and computationally demanding, making them less feasible in contexts with limited resources or smaller datasets [24]. Collecting and analyzing large volumes of water quality data often requires substantial investment in infrastructure, technology, and human expertise—barriers that can be prohibitive in resource-constrained settings. Therefore, more accessible and computationally efficient machine learning models offer a practical alternative for predictive water quality modeling.
In response to this challenge, numerous studies have employed ML techniques such as artificial neural networks, support vector machines, and others to estimate microbial contamination levels, particularly E. coli concentrations, based on physicochemical indicators. Stocker et al. [25] conducted a comparative evaluation of five machine learning algorithms, including stochastic gradient boosting machines, random forests, support vector machines, and k-nearest neighbors, for predicting E. coli concentrations in agricultural pond waters. Among the models tested, the random forest algorithm achieved the highest predictive accuracy, yielding the lowest RMSE values. Weller et al. [26] utilized previously published datasets to develop and evaluate predictive models for E. coli, employing multiple machine learning algorithms and performance metrics for comparison. A study on the Göta älv River in Gothenburg, Sweden, evaluated data-driven models of varying complexity for predicting E. coli at a drinking water intake [27]. Models ranged from traditional statistical methods (Exponential Smoothing, ARIMA, VAR) to machine learning approaches, including LASSO regression, Random Forest, and TPOT. Results showed that multivariate models outperformed univariate baselines, with Random Forest and TPOT achieving the highest accuracy, though with some overfitting. Abimbola et al. [28] addressed the challenges of predicting E. coli contamination in surface waters by incorporating hydro-climatic variables, animal density, and grazing patterns into the modeling process. Using regression methods, ANN, and two adaptive neuro-fuzzy inference systems (ANFIS) structures, they compared predictive accuracy across models. Results showed that while most approaches performed well, ANFIS models achieved the lowest error rates. Khan et al. [29] investigated groundwater quality prediction using data from the BITS-UVA contamination project. They proposed a superposition-based learning algorithm combined with ANN sensitivity analysis to identify key parameters influencing E. coli presence. Results indicated that turbidity, pH, total dissolved solids (TDS), and electrical conductivity were the most effective predictors, with the optimized ANN achieving an of 0.90 and an MSE of 0.0892. Iyer et al. [30] investigated E. coli contamination forecasting in urban streams of Marion County, Indiana, using 20 years of climatic and water quality data. Six machine learning models, including logistic regression, decision trees, random forests, gradient boosting, and XGBoost, were applied to predict bacterial pollution levels. Feature importance analysis highlighted climatic factors such as temperature and precipitation as key predictors. Among the tested models, XGBoost consistently achieved the highest performance, with AUC-ROC values exceeding 85% across all study sites. Nafsin et al. [31] developed an AI-driven mobile application for predicting E. coli contamination levels in surface waters using real-time sensor data on temperature, pH, dissolved oxygen, and turbidity. Several machine learning models, including SVR, Random Forest, XGBoost, and ensemble techniques, were evaluated for predictive performance. Their study concluded that ensemble-hybrid models, particularly ANN-GBM, achieved the highest accuracy, with values of up to 0.97 for total organic carbon (TOC) prediction, though E. coli prediction remained challenging due to high variability in microbial data.
Building upon this foundation, the present study evaluates the predictive performance of five widely used ML algorithms, RF, SVM, kNN, ANN, and XGBoost, for estimating E. coli concentrations in Midmar Dam over 20 years (2004–2024) using historical physicochemical water-quality data. The analysis focuses on model accuracy and a comparative assessment based on MAE, MSE, and RMSE. This study contributes to the growing body of evidence supporting data-driven ML approaches as effective tools for water-quality surveillance and proactive environmental management.
2. Materials and Methods
2.1. Study Area and Data
This study was conducted using data collected from Midmar Dam, in accordance with the established monitoring program, which prescribes the frequency and parameters to be assessed. Midmar Dam is a strategically significant freshwater reservoir located near the towns of Howick and Pietermaritzburg in KwaZulu-Natal Province, South Africa. Midmar Dam is a hybrid structure, combining gravity and earth-fill dam construction, and is situated within a broad valley in the upper uMngeni River catchment. The region is characterized by high annual precipitation and favorable hydrological conditions, with the uMngeni River the principal tributary feeding the dam, providing an estimated yearly mean runoff of approximately 158.5 million cubic meters of water [32]. The geographical location of Midmar Dam is shown in Figure 1.
Figure 1.
Study area: Midmar Dam in Howick, KwaZulu Natal, South Africa.
Hydroclimatic conditions and land use are the key drivers of the prevailing water quality pattern in the Midmar Dam. They are responsible for the seasonal/temporal water quality variations in the Midmar Dam. The wet season, characterized by storm events, results in high river flows and the transport of microbiological and physicochemical constituents into the dam. Most of the catchment is under large-scale agriculture with some intensive production such as piggeries, dairies, and vegetable production. Surface runoff from high rainfall or flood events transports sediment, nutrients, and sewage into the reservoir. Elevated E. coli, suspended solids, turbidity, and nutrients results are recorded in Midmar Dam when there have been major storm events or floods. The associated pathogens and nutrients pollution is pronounced when there are storm events (high rainfall) and related runoff. In 2015, Midmar Dam experienced drought conditions, which significantly reduced the dilution factor of the reservoir, negatively impacting the water quality status of the dam.
The dataset used in this study spans 20 years, from 2004 to 2024, and consists of routinely collected physicochemical and microbiological observations from Midmar Dam. The water quality parameters include Escherichia coli (E. coli), fluoride (F), coliforms, phenols, iron, dissolved oxygen (DO OS), pH (pH OS), temperature, and turbidity. These parameters provide a comprehensive representation of both microbial contamination and the underlying physicochemical conditions influencing water quality in the reservoir.
2.2. Data
Water samples were collected in accordance with the established monitoring program, which prescribes daily, weekly, or monthly sampling depending on the type of pollutant to be assessed. On-site analyses were performed for selected physicochemical parameters, while the remaining studies were conducted in the laboratory. Sampling was conducted at various depths within the water column of Midmar Dam to support both operational requirements and the detection of potential impurities or pathogens that may pose risks to treatment processes and public health. Sampling near the dam wall was conducted using a boat (Explorer 510, Motor Yamaha 85 hp) and standard field equipment (Aquaread, Water Quality instruments, Kent, UK), including depth samplers, integrated samplers, sample containers, and portable water quality meters for on-site measurements of dissolved oxygen (DO), pH, and temperature.
The sample collection and analysis procedures were as follows:
- Depth sampling: A depth sampler was used to collect water samples at different intervals throughout the water column (e.g., 2 m, 4 m, up to 22 m, depending on the dam’s height). At the target depth, the sampler was triggered to close, thereby capturing water at the specified depth. These samples provided a vertical profile of water quality parameters relevant to abstraction levels used for treatment.
- Integrated sampling: A 4 m integrated sampler was employed to obtain composite samples representing the average water quality across multiple depths. This involved collecting water from the surface to approximately 8 m below the surface, integrating samples at four different levels. The collected water was transferred into plastic containers for preservation and transport.
- Onsite physicochemical analysis: A handheld multi-parameter probe was used to measure DO, pH, and temperature directly at the sampling site. Measurements were recorded at 2 m intervals from the surface to the bottom of the water column. Each record was accompanied by metadata, including sampling depth, dam water level, geographic coordinates, altitude, and time-stamped measurements.
- Sample storage and transport: Samples were preserved in plastic or glass containers of varying volumes (0.5 L, 1 L, and 5 L), according to laboratory testing requirements. All containers were stored in cooler boxes to maintain sample integrity during transportation to the laboratory for further analysis.
- Turbidity testing: Turbidity, caused by microorganisms, clay, silt, suspended solids, and soluble compounds, was measured using a nephelometer or laser-based instrument (Hach, 2100 AN turbidimeter, Loveland, CO 80539-0389, USA) that determines the intensity of light scattered by the sample. Results were expressed in nephelometric turbidity units (NTU), providing an assessment of particle load and the effectiveness of treatment processes.
- Microbial analysis (Coliforms and E. coli): Microbiological testing was performed in the laboratory to detect the presence of coliform bacteria and E. coli, which serve as indicators of fecal contamination and potential pathogen presence. The Colilert 24-h test was employed, which detects and quantifies these organisms through the activity of the enzymes -D-galactosidase (for total coliforms) and -D-glucuronidase (for E. coli). These enzyme-substrate reactions provide a sensitive and reliable means of assessing microbial water quality.
2.3. Data Preprocessing
Effective preprocessing of raw data is a prerequisite for building reliable predictive models, as it ensures data quality, consistency, and comparability across variables [33]. In this study, the dataset obtained from Midmar Dam contained physicochemical and microbiological parameters, including E. coli, Coliforms, Dissolved Oxygen (DO OS), pH (pH OS), Temperature, Turbidity, Fluoride, Phenols, and Iron.
The dataset employed in this study spans a 20-year period 2004–2024 and comprises routinely collected physicochemical and microbiological measurements from Midmar Dam. Water quality monitoring is conducted primarily on a fortnightly basis, in accordance with the standard operational monitoring program. However, the sampling frequency is increased to weekly during periods requiring heightened surveillance, such as suspected water quality deterioration or episodic contamination events. Figure 2 illustrates the geographical location of the sampling site, situated at coordinates 29°29′47.33′′ S and 30°12′5.66′′ E. This site is positioned within the main basin of the reservoir, ensuring that the collected data reflect the broader water quality dynamics rather than localized littoral conditions. To maintain representativeness, the monitoring point is revalidated every five years by conducting comparative sampling across multiple locations within the reservoir and evaluating inter-site correlations to confirm consistency in water quality profiles.
Figure 2.
The location of the water quality sampling point.
Before model development, several preprocessing steps were undertaken. First, the parameters with few samples were removed. Second, the dataset was examined for missing values, which were subsequently addressed using the K-Nearest Neighbors (KNNImputer) algorithm. Unlike traditional mean or median substitution methods, KNNImputer leverages multivariate relationships by estimating missing values based on the Euclidean distance of the nearest neighbors [34]. This approach preserves the intrinsic data structure while minimizing information loss, thereby improving the robustness of downstream modeling. Third, to eliminate dimensional inconsistencies among predictors, all features were standardized using Z-scores. This method rescales each component of the feature vectors to obtain a standardized feature space; each element of the feature vectors has a mean of zero and a standard deviation of one. This ensures equal weighting of features regardless of their original units. Standardization also reduces the impact of residual outliers and enhances comparability across multidimensional variables. Let be the feature space, made of the water quality parameters, with n being the number samples in the dataset. The standardized of the ith component, , is calculated as:
where represents the jth component of the ith feature vector, , with and representing the mean and standard deviation of jth component, respectively.
Finally, the preprocessed dataset was partitioned into training (80%) and testing (20%) subsets to facilitate model training, hyperparameter optimization, and evaluation. The training data were used to fit the models and identify optimal parameters through cross-validation, while the independent test data provided an unbiased estimate of predictive performance. Through these systematic preprocessing steps (removing parameters with few samples, imputation, standardization, and data partitioning), the dataset was prepared to enable the accurate and reliable application of machine learning algorithms for E. coli prediction.
2.4. Model Development
In this study, we aim to develop a suitable prediction model for E. coli to facilitate preemptive action. Five different ML models for comparison, including RF, SVM, kNN, ANN, and XGBoost, are used, and their performance metrics are compared. The selection of these was motivated by their complementary strengths and distinct algorithmic foundations, enabling a comprehensive evaluation of predictive approaches for E. coli concentrations. Each model represents a different methodological paradigm: SVM (SVR) effectively handles both linear and non-linear regression by capturing complex dependencies through kernel functions; XGBoost, a gradient-boosting framework, excels at modeling intricate feature interactions while incorporating regularization and computational efficiency; RF provides robustness through ensemble averaging of decision trees and offers insights into variable importance; kNN leverages localized similarity in feature space, making it well-suited for non-stationary and event-driven patterns; and ANN mimics neural processing to learn complex, non-linear relationships without explicit functional assumptions.
By comparing these diverse machine learning models, this study aims to identify the most effective and reliable approach for predicting E. coli concentrations, taking into account the dataset’s characteristics and the research objectives. To preserve temporal dependencies inherent in the environmental monitoring data and to avoid information leakage, the dataset was partitioned chronologically. Observations from 2004 to 2019 (approximately 80%) were used for model training and hyperparameter optimization, while the most recent data from 2020 to 2024 (approximately 20%) were reserved for independent testing. This strategy ensures a realistic evaluation of model generalization to unseen future conditions. An overview of the proposed methodological framework is illustrated in Figure 3, and the optimized hyperparameter configurations for each model are summarized in Table 1. Detailed descriptions of the individual models are provided in the subsequent subsections.
Figure 3.
The schematic of the proposed method.
Table 1.
Tuned hyperparameter values for machine learning models.
2.4.1. Support Vector Machines (SVM)
Building on their successful application in many existing works on water quality prediction [10,31], Support Vector Regression (SVR) approach is employed in this study to model the relationship between physicochemical water quality parameters and E. coli concentrations. SVR finds a function that predicts target values within a certain tolerance margin (), defined as ref. [35]:
where y is the predicted E. coli, x an input data vector, represents kernel functions, is the learned weight vector, defining the direction of the decision boundary, and b is the bias parameter that defines the hyperplane’s offset. These attributes make SVM well-suited for predicting water quality parameters, particularly when data exhibit non-linearity, irregularity, and variability. As indicated in Table 1, our experiments’ hyperparameters were tuned to improve the predictive accuracy of the SVM model. The kernel was set to radial basis function (), as it effectively captures complex non-linear relationships among variables. The regularization parameter (C) was optimized to strike a balance between minimizing prediction error and avoiding overfitting, thereby enhancing generalization. Similarly, the gamma () parameter, which defines the influence of individual training samples, was adjusted to control the shape of the decision boundary.
2.4.2. Random Forest
The RF model is a widely used ensemble learning algorithm that builds multiple decision trees and aggregates their predictions to enhance accuracy and generalization [36]. In this study, RF was employed to evaluate its effectiveness in predicting E. coli concentrations and to identify the relative importance of input features. The algorithm is particularly robust in handling complex datasets with high-dimensional and correlated variables. By randomly selecting subsets of features for each tree, RF mitigates overfitting and reduces bias. Its ability to capture non-linear relationships and feature interactions makes it suitable for environmental data modeling. Furthermore, RF requires minimal hyperparameter tuning and operates without strict assumptions about data distribution. The method also provides feature importance scores, offering valuable insights into the contribution of each predictor variable [37]. These characteristics make RF a strong candidate for regression tasks involving water quality prediction. The foundation of RF lies in regression trees, which are constructed through recursive partitioning of the input dataset into subsets. At each stage, the algorithm evaluates all possible splits and selects the one that minimizes variance within the resulting nodes [38]. This iterative process continues until the optimal tree structure is formed. The impurity at a given node t is quantified as:
where is the number of samples at node t, represents the observed target value for the ith formatting sample, and denotes the mean target value within node t. The value of thus measures the homogeneity of the node, with lower values indicating purer partitions and guiding the tree-splitting process. As indicated in Table 1, hyperparameters were systematically tuned to optimize the predictive performance of the RF model. The number of trees () was set to 100, providing a balance between computational efficiency and model stability. The maximum depth of trees was limited to prevent overfitting while capturing relevant feature interactions. Additionally, the minimum samples per split parameter was adjusted to ensure that each node contained sufficient observations for reliable decision-making.
2.4.3. k-Nearest Neighbors
The k-Nearest Neighbors (kNN) algorithm is a non-parametric, instance-based learning method used for both regression and classification tasks [25,39]. In this study, kNN was applied to predict E. coli concentrations based on its ability to model non-linear relationships by capturing local patterns in the data. The algorithm predicts outcomes by calculating distances between a test instance and its k closest training samples, using a chosen distance metric. Its simplicity, flexibility, and effectiveness in handling mixed data types make it suitable for environmental applications. However, computational cost can increase with large datasets, and model performance depends heavily on the optimal selection of k and the distance function.
Despite these limitations, kNN provides reliable predictions and performs well in water quality modeling tasks. Its ability to respond to localized data variations makes it particularly effective for understanding the dynamic behaviors of microbes in freshwater systems. The kNN algorithm was configured using uniform weights and the Euclidean distance metric to quantify similarity between data points. This decision rule ensures that the predicted class corresponds to the category most frequently represented among the nearest neighbors. Formally, given a training dataset with . Given the test instance , and with .
Compute the distances . Let be a permutation of indices that sorts distances in increasing order. Define the neighbor index set of size k as:
With uniform weights, the regression prediction target of x is defined as:
As seen in Table 1, hyperparameter tuning was conducted to optimize the performance of the kNN model. The number of neighbors (k) was set to 5, ensuring a balance between sensitivity to local fluctuations and robustness against noise. The distance metric was fixed to Euclidean distance, which effectively captures geometric similarity among physicochemical parameters. Additionally, uniform weighting was applied so that each of the selected neighbors contributed equally to the prediction outcome.
2.4.4. Extreme Gradient Boosting (XGBoost)
XGBoost is a powerful tree-based ensemble learning method [40] that builds predictive models by sequentially combining weak learners to minimize prediction error. The algorithm operates by optimizing a regularized objective function that strikes a balance between model accuracy and complexity, thereby helping to prevent overfitting. Each new decision tree in the ensemble is constructed to correct the residual errors of previous trees, thereby enhancing the model’s performance iteratively. XGBoost also efficiently handles missing data and supports parallel processing, making it well-suited for large and complex datasets. Its robust predictive capability and scalability offer significant advantages for water quality modeling. An XGBoost is based on a gradient boosting architecture, where, given the parameters vector x, the predicted output, , is computed as [41]:
where n denotes the number of estimators, and F is the space of all regression trees. Boosting is used, that starts with constant prediction, and proceeds with the following:
The objective is choice of the f to add at each stage t that minimizes, , defined as:
where is the training loss and is the Tree complexity.
Further insights into the application of XGBoost algorithms for water quality control can be found in refs. [42,43,44]. Table 1 shows the XGBoost model hyperparameters that were tuned to optimize its predictive performance for E. coli concentrations. Specifically, the parameter was set to 100, controlling the number of boosting rounds and ensuring sufficient model capacity without excessive overfitting. To ensure reproducibility, a fixed was applied during model development.
2.4.5. Artificial Neural Network
The ANNs are computational models inspired by the structure and functioning of the human brain, capable of learning complex patterns through interconnected layers of artificial neurons [45]. ANNs consist of input, hidden, and output layers, where learning occurs through the adjustment of weights during training. The model does not require explicit rules or prior knowledge, making it suitable for problems with unknown underlying relationships. ANNs have been successfully applied across various scientific and engineering domains due to their adaptability, pattern recognition capabilities, and generalization performance [46]. This makes ANN a valuable tool in forecasting microbial contamination in water bodies, aiding timely and informed water management decisions.
A standard feedforward neural network comprises an input layer, one or more hidden layers, and an output layer. Its operation involves two iterative processes: (i) feedforward propagation, where input values are multiplied by their associated weights and transmitted through the network until the output layer is reached, and (ii) backpropagation, where the prediction error is calculated and propagated backward to update the weights [47]. Given a network with L layers (layer index ), and a vector , where d is the number of water quality parameters, the trained parameters , give the following mapping from input vector to the predicted scalar is:
where, for layer l, is the activation function, the weight matrix is , and the bias vector is .
Table 1 presents the ANN model hyperparameter tuning configuration designed to optimize the prediction of E. coli concentrations. The network architecture consisted of three hidden layers, each with 20 neurons, which provided sufficient representational capacity without overfitting the dataset. The softplus activation function was applied in the hidden layers to capture non-linear relationships, while the output layer used a linear activation to suit regression tasks. The model was trained using the Adam optimizer, chosen for its adaptive learning rate and efficiency in handling sparse gradients, with mean squared error (MSE) as the loss function. Training was performed for 100 epochs with a batch size of 10, ensuring stability and convergence.
2.5. Assessment of Model Performance
The predictive performance of each algorithm was assessed using three statistical indicators: MAE, MSE, and RMSE. These metrics provide complementary perspectives on model accuracy by quantifying average error magnitude, penalizing larger deviations, and reflecting overall prediction quality [48,49]. The mathematical formulations of these performance measures are given below:
where n is the total number of data samples, and are, respectively, the actual and predicted values of the sample.
3. Experimental Results and Discussion
3.1. Descriptive Statistics of Water Quality
Table 2 summarizes the descriptive statistics of the physicochemical and microbiological parameters measured in Midmar Dam between 2004 and 2024. The results highlight the variability and seasonal dynamics of water quality conditions in the reservoir. The pH values ranged within a relatively narrow band, with a mean close to neutrality (7.7), reflecting generally stable and slightly alkaline conditions conducive to aquatic life. Dissolved oxygen exhibited substantial fluctuations (0.0–10.4 mg/L, mean 3.9 mg/L), indicating episodes of oxygen depletion that may stress aquatic organisms and influence microbial survival. Water temperature varied moderately across the dataset, with average values typical of the regional climate, which supports microbial activity, including the persistence and growth of E. coli. Turbidity exhibited episodic spikes (mean 6.5 NTU, maximum > 80 NTU), indicating short-term events of high sediment or organic load, likely driven by rainfall and catchment runoff. Microbiological indicators demonstrated extreme variability. E. coli concentrations ranged from non-detectable levels to values exceeding 24,000 MPN/100 mL, indicating intermittent but severe fecal contamination events. Similarly, total coliforms exhibited wide fluctuations with maxima above 24,000 MPN/100 mL, reinforcing the risks of microbial pollution to water users.
Table 2.
Statistical summary of the water quality parameters during the sampling period of 2004–2024.
The extreme E. coli values are linked to high river flows in a catchment that has sewage pollution and extensive agricultural activities. The extreme E. coli result was recorded during sampling undertaken after a storm event followed by rainfall in the catchment. Pathogens are among the pollutants transported into the reservoir by rainfall-related runoff. The root cause is the sewage management challenges and agricultural activities within the catchment. Among the additional parameters, fluoride concentrations remained low and relatively stable, well within acceptable limits for drinking water, suggesting minimal influence from industrial or geological sources. Phenols exhibited consistently low mean values, but occasionally showed detectable spikes, indicating localized and possibly episodic contamination sources. Iron levels were generally low but displayed episodic increases, potentially associated with natural sediment mobilization or catchment erosion events. Collectively, these statistics indicate that while Midmar Dam typically maintains acceptable physicochemical conditions, sporadic but severe surges in turbidity, coliforms, and E. coli concentrations present significant microbial water quality challenges. The variability observed across parameters underscores the need for predictive modeling approaches that can capture complex, non-linear, and event-driven dynamics to support proactive water-quality monitoring and management.
In this study, Pearson’s correlation coefficient was applied to assess the strength of association between input parameters and the target variable. Pearson’s correlation analysis at the 0.05 level of significance was conducted to determine the relationships between E. coli concentrations and other physicochemical parameters in Midmar Dam Table 3. The results indicate that all correlations, except for turbidity, coliforms, and temperature, were statistically significant (). Although dissolved oxygen and pH returned statistically significant p-values, their corresponding correlation coefficients with E. coli (R = −0.038 and R = −0.037, respectively) are extremely small. These values explain less than 0.01% of the variance in E. coli, indicating that the observed relationships are negligible from a practical perspective. All other parameters: phenols (R = 0.017, p = 0.233), turbidity (R = −0.016, p = 0.256), coliforms (R = 0.015, p = 0.284), fluoride (R = −0.009, p = 0.511), iron (R = 0.004, p = 0.738), and temperature (R = 0.002, p = 0.856) displayed extremely weak correlations and were not statistically significant (p > 0.05), indicating negligible linear association with E. coli levels in this dataset.
Table 3.
Pearson’s correlation coefficients between E. coli and other parameters at 0.05 level of significance.
Overall, the low R-values (<0.3) suggest that E. coli concentrations in Midmar Dam are influenced by complex, potentially non-linear interactions with physicochemical parameters, rather than strong direct linear relationships. Figure 4 shows the heatmap of correlations between E. coli concentration and other parameters.
Figure 4.
Heatmap of correlations between E. coli concentration and other parameters.
3.2. Selected Input Variables
While Pearson’s correlation analysis provided initial insights into the statistical relationships between E. coli and individual physicochemical parameters, it is limited to capturing only linear associations. It does not account for potential non-linear interactions within complex datasets. To overcome this limitation, a decision-tree-based Random Forest (RF) algorithm was employed to evaluate the relative importance of each predictor variable in estimating E. coli concentrations. Feature importance scores, normalized to sum to one, quantify the contribution of each variable, with higher scores indicating stronger predictive relevance.
It is well recognized that RF feature importance, particularly impurity-based measures, can be biased toward variables with more categories or broader numerical ranges. However, RF was used in this study for two key reasons. First, RF provides an efficient and interpretable initial screening tool for identifying influential predictors. Second, our objective was not to infer causal effects but to inform feature selection for subsequent predictive modeling. For this purpose, RF importance offers a robust, computationally efficient, and widely validated method for prioritizing variables in environmental applications.
As shown in Figure 5, turbidity emerged as the most influential parameter with an importance score of 0.28, followed by temperature (0.24), coliforms (0.18), dissolved oxygen (DO OS) (0.15), and pH (0.13). In contrast, phenols (0.02), iron (0.00), and fluoride (0.00)exhibited negligible contributions. These findings indicate that microbial and physicochemical parameters directly linked to water quality dynamics—particularly turbidity, temperature, and coliforms are key determinants of E. coli variability in Midmar Dam. To enhance model efficiency and reduce noise, only the top five parameters with comparatively higher feature importance scores (coliforms, dissolved oxygen, pH, temperature, and turbidity) were retained as input variables for developing the predictive models. This feature selection strategy ensured that the models focused on the most relevant predictors, thereby improving accuracy, reducing computational complexity, and minimizing the risk of overfitting.
Figure 5.
Feature importances for predicting E. coli.
3.3. Comparative Analysis
The predictive performance of the five machine learning models, RF, SVM, kNN, ANN, and XGBoost, was evaluated using three statistical error metrics: MAE, MSE, and RMSE Table 4. All models were trained and tested on the same dataset to ensure a fair comparison, with the predictor variables comprising Escherichia coli (E. coli), Coliforms, Dissolved Oxygen (DO OS), pH (pH OS), Temperature, and Turbidity.
Table 4.
Performance of different ML models at the Midmar Dam.
A visual comparison of the performance metrics, presented in Figure 6, highlights apparent differences in predictive accuracy among the models. The results indicate that kNN achieved the lowest MAE (0.0585), MSE (0.0037), and RMSE (0.0609), demonstrating its superior ability to capture the relationships between physicochemical parameters and E. coli concentrations in Midmar Dam. XGBoost ranked second, followed closely by SVM, while RF and ANN exhibited comparatively higher error values. Overall, the comparative analysis confirms that kNN is the most effective model for predicting E. coli levels for this dataset, likely due to its ability to capture localized patterns and non-linear relationships inherent in environmental water quality data. The consistency of results across all three evaluation metrics further supports its suitability for practical applications in real-time water quality monitoring and decision-making for Midmar Dam.
Figure 6.
RMSE, MSE and MAE comparison for the prediction of E. coli.
3.4. Discussion
This study compared the performance of five machine learning (ML) models for predicting E. coli concentrations in Midmar Dam using physicochemical water quality parameters. The descriptive statistics reveal generally stable pH (mean 7.75, SD 0.33) but substantial variability in dissolved oxygen (0.00–10.40 mg/L, mean 3.85 mg/L) and episodic turbidity peaks (mean 6.48 NTU, max 84.10 NTU). E. coli and total coliform counts exhibited extreme variability, with maxima of 24,069 and 24,196 MPN/100 mL, respectively, indicating intermittent yet severe contamination events likely driven by hydrometeorological and catchment influences. Pearson’s correlation analysis revealed only weak linear relationships between E. coli and individual predictors, with DO and pH exhibiting small but statistically significant negative correlations. In contrast, turbidity, coliforms, and temperature were not found to be statistically significant. This underscores the multivariate and non-linear nature of E. coli dynamics, favoring models that can capture complex interactions. Among the tested algorithms, kNN achieved the lowest MAE (0.0585), MSE (0.0037), and RMSE (0.0609), outperforming XGBoost, SVM, RF, and ANN.
The superior performance of kNN reflects its strength in leveraging localized patterns in the data, a key advantage for modeling nonstationary and event-driven systems. In contrast, RF may lose fine-scale locality through ensemble averaging, while ANN performance can be sensitive to architecture and dataset size. These results are consistent with prior studies demonstrating the usefulness of ML for modeling complex microbial–environment interactions. For example, Stocker et al. [25] compared several ML algorithms, including RF, SVM, SGB, and kNN, for predicting E. coli in agricultural ponds and found that all ML models performed well, with RF providing the lowest RMSE values in most cases. However, they also noted that when RMSE and other performance indicators were treated as statistical quantities, no significant differences were observed between the ML algorithms, reinforcing the view that multiple ML methods can achieve comparable accuracy when relationships are highly non-linear. The present study similarly observed that although kNN performed best overall, both XGBoost and SVM produced strong and competitive results, supporting the general finding that several ML approaches can effectively handle microbial water quality prediction. Additionally, the findings of this study align with those of another recent work by Kuroki et al. [50], who assessed logistic regression, SVM, RF, and LightGBM for predicting E. coli contamination in Nepali tap water systems. Their findings showed that SVM produced the most reliable and accurate results, especially when data features defied conventional statistical presumptions such as independence. This demonstrates a key benefit of SVM and other machine learning techniques: they are suitable for diverse datasets, such as water-quality observations, because they can predict intricate, non-linear relationships without requiring rigorous distributional assumptions. But the study also identified significant disadvantages. Both LightGBM and RF exhibited overfitting tendencies, particularly in areas with more intricate water supply arrangements, suggesting that ensemble tree techniques may become unduly sensitive to highly variable or noisy inputs.
A deliberate choice was made to employ machine learning models rather than deep learning architectures. Deep learning methods often require huge datasets, extensive computational resources, and considerable hyperparameter tuning to achieve optimal performance. Given the moderate dataset size, conventional ML models offered a more practical, interpretable, and computationally efficient solution. Importantly, ML algorithms such as kNN, RF, and SVM are well-suited for small- to medium-sized datasets and allow easier integration into real-time monitoring frameworks compared with more opaque and resource-intensive deep learning models.
In the ANN model, an architecture with 20 neurons was selected after testing configurations with 10, 15, 25, and 30 neurons. This 20-neuron structure effectively balanced underfitting and overfitting. The 20-neuron design offered consistent convergence and sufficient complexity without compromising robustness. The results are promising, as they demonstrate that relatively simple, non-parametric models, such as kNN, can outperform more sophisticated learners in microbial water-quality prediction under certain conditions. This highlights the importance of model selection based on data characteristics rather than algorithmic complexity. The study underscores that computationally efficient ML models, when integrated with near-real-time sensing systems, can enhance proactive risk management in freshwater reservoirs such as Midmar Dam. These findings provide a strong foundation for future operationalization of ML-based prediction tools in water-quality monitoring and public health protection.
4. Conclusions
This study developed and compared five data-driven machine learning models, RF, SVM, kNN, ANN, and XGBoost, to predict E. coli concentrations in Midmar Dam from physicochemical water-quality parameters. Models were trained on a dataset spanning 2004–2024 (4918 observations) after preprocessing. Model performance was assessed on a held-out test set using MAE, MSE, and RMSE. The comparative evaluation shows that kNN produced the best predictive accuracy for this dataset (MAE = 0.0585, MSE = 0.0037, RMSE = 0.0609), followed by XGBoost and SVM, while RF and ANN yielded larger errors. These results indicate that instance-based (local) modeling effectively captured the localized, non-linear patterns in the Midmar Dam data. In contrast, tree-based ensemble and kernel methods also provided strong but slightly less optimal performance under the present data constraints. The following important implications can be drawn from the study:
- Relatively simple, non-parametric approaches such as kNN can be highly effective for microbial water-quality prediction when datasets are moderate in size and exhibit pronounced local patterns.
- Gradient-boosting (XGBoost) remains a robust alternative when computational efficiency, regularization, and handling of complex interactions are required.
- The generally low Pearson R-values between E. coli and individual physicochemical predictors suggest that predictive success depends on multivariate, potentially non-linear relationships rather than strong single-variable drivers; this motivates the continued use of ML methods that capture interactions.
The study has several limitations that temper the generalizability and ecological interpretability of its findings. Although E. coli dynamics in freshwater systems are strongly influenced by anthropogenic and natural drivers such as rainfall-induced runoff, hydrodynamic mixing, and land-use activities, these factors were not incorporated into the present models due to data unavailability and differing temporal resolutions. As a result, the models rely solely on physicochemical parameters measured at the dam. Our future work will focus on experimental and methodological enhancements. First, we will incorporate additional exogenous predictors, such as rainfall-induced runoff, hydrodynamic mixing, and land-use activities, as well as remote-sensing proxies, to address the current limitation of relying solely on physicochemical parameters. Second, ensemble strategies such as stacking kNN with XGBoost, RF, or SVR will be tested to assess whether model diversity can reduce variance and improve robustness under extreme contamination events. In summary, ML-based prediction of E. coli from physicochemical parameters demonstrates clear potential as a complementary tool to laboratory monitoring, offering faster and scalable insights into microbial risk, provided that models are carefully validated, updated with additional covariates, and integrated within a broader water-quality management framework.
Author Contributions
Conceptualization, A.A.M.S.I., T.W. and J.-R.T.; methodology, A.A.M.S.I., T.W., M.N. (Mfanasibili Nkonyane) and J.-R.T.; software, A.A.M.S.I.; validation, A.A.M.S.I., T.W. and J.-R.T.; formal analysis, A.A.M.S.I., T.W., M.N. (Mfanasibili Nkonyane), M.N. (Mlondi Ngcobo) and J.-R.T.; investigation, A.A.M.S.I., T.W. and J.-R.T.; resources A.A.M.S.I., T.W., M.N. (Mfanasibili Nkonyane), M.N. (Mlondi Ngcobo) and J.-R.T.; data curation, A.A.M.S.I., T.W., M.N. (Mfanasibili Nkonyane), M.N. (Mlondi Ngcobo) and J.-R.T.; writing—original draft preparation, A.A.M.S.I.; writing—review and editing, A.A.M.S.I., T.W. and J.-R.T.; visualization, A.A.M.S.I.; supervision, T.W. and J.-R.T.; project administration, T.W.; funding acquisition, T.W. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.
Conflicts of Interest
Author Mfanasibili Nkonyane and Mlondi Ngcobo were employed by Umngeni-Uthukela Water. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| ANN | Artificial Neural Network |
| ANFIS | Adaptive Neuro-Fuzzy Inference System |
| ARIMA | Autoregressive Integrated Moving Average |
| BR | Bayesian Regularization |
| CNN | Convolutional Neural Network |
| DO | Dissolved Oxygen |
| EC | Electrical Conductivity |
| KNN | k-Nearest Neighbors |
| MAE | Mean Absolute Error |
| ML | Machine Learning |
| MLP | Multilayer Perceptron |
| MSE | Mean Squared Error |
| NDOC | Non-Dissolved Organic Carbon |
| RF | Random Forest |
| RMSE | Root Mean Squared Error |
| RMSLE | Root Mean Squared Logarithmic Error |
| R2 | Coefficient of Determination |
| SLA | Superposition-based Learning Algorithm |
| SVM | Support Vector Machine |
| SVR | Support Vector Regression |
| TOC | Total Organic Carbon |
| TPOT | Tree-based Pipeline Optimization Tool |
| TS | Total Solids |
| TSS | Total Suspended Solids |
| VSS | Volatile Suspended Solids |
| WQI | Water Quality |
| XGBoost | Extreme Gradient Boosting |
References
- Hamouda, M.A.; Jin, X.; Xu, H.; Chen, F. Quantitative microbial risk assessment and its applications in small water systems: A review. Sci. Total Environ. 2018, 645, 993–1002. [Google Scholar] [CrossRef] [Scilit]
- Hou, X.; Qin, L.; Wang, F.; Xu, M.; Yu, C.; Zhang, Y.; Zhang, T.; Wu, B.; Wang, D.; Li, M. Faecal contamination in China: Trends, sources, and driving mechanisms. Water Res. 2024, 261, 122017. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Ramesh, G.P. Advanced Water Quality Assessment with IOT WSN and Multivariate Machine Learning Techniques. In Proceedings of the 2025 3rd International Conference on Integrated Circuits and Communication Systems ICICACS, Raichur, India, 21–22 February 2025; Volume 21, pp. 1–6. [Google Scholar]
- Payus, C.; Haziqah, N.; Basri, N.; Wan, V.L. Faecal Bacteria Contaminations in Untreated Drinking Water (Groundwater Well and Hill Water) from Rural Community Areas. Int. J. Adv. Sci. Technol. IJAST 2018, 158, 215–218. [Google Scholar]
- WHO. Guidelines for Drinking-Water Quality: Fourth Edition Incorporating the First Addendum; World Health Organization: Geneva, Switzerland, 2017. [Google Scholar]
- Khan, F.M.; Gupta, R.; Sekhri, S. A Convolutional Neural Network Approach for Detection of E. coli Bacteria in Water. Environ. Sci. Pollut. Res. 2021, 28, 60778–60786. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kenchannavar, H.H.; Pujar, P.M.; Kulkarni, R.M.; Kulkarni, U.P. Evaluation and analysis of goodness of fit for water quality parameters using linear regression through the Internet-of-Things-based water quality monitoring system. IEEE Internet Things J. 2021, 9, 14400–14407. [Google Scholar] [CrossRef] [Scilit]
- Zhu, M.; Wang, J.; Yang, X.; Zhang, Y.; Zhang, L.; Ren, H.; Wu, B.; Ye, L. A review of the application of machine learning in water quality evaluation. Eco-Environ. Health 2022, 1, 107–116. [Google Scholar] [CrossRef] [Scilit]
- Barzegar, R.; Aalami, M.T.; Adamowski, J. Short-term water quality variable prediction using a hybrid CNN–LSTM deep learning model. Stoch. Environ. Res. Risk Assess. 2020, 34, 415–433. [Google Scholar] [CrossRef] [Scilit]
- Najafabadi, E.F.; Shojaei, P.; Askarizadeh, M. Comparative Analysis of Machine Learning Models for Predicting River Water Quality: A Case Study of the Zayandeh Rood River. Results Eng. 2025, 27, 106665. [Google Scholar] [CrossRef] [Scilit]
- Liang, Z.; Zou, R.; Chen, X.; Ren, T.; Su, H.; Liu, Y. Simulate the forecast capacity of a complicated water quality model using the long short-term memory approach. J. Hydrol. 2020, 581, 124432. [Google Scholar] [CrossRef] [Scilit]
- Singh, Y.; Walingo, T. Smart water quality monitoring with IOT wireless sensor networks. Sensors 2024, 24, 2871. [Google Scholar] [CrossRef] [Scilit]
- Singha, S.; Pasupuleti, S.; Singha, S.S.; Singh, R.; Kumar, S. Prediction of groundwater quality using efficient machine learning technique. Chemosphere 2021, 276, 130265. [Google Scholar] [CrossRef] [Scilit]
- Prasad, D.V.V.; Venkataramana, L.Y.; Kumar, P.S.; Prasannamedha, G.; Harshana, S.; Srividya, S.J.; Harrinei, K.; Indraganti, S. Analysis and prediction of water quality using deep learning and auto deep learning techniques. Sci. Total Environ. 2022, 821, 153311. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Raheja, H.; Goel, A.; Pal, M. Prediction of groundwater quality indices using machine learning algorithms. Water Pract. Technol. 2022, 17, 336–351. [Google Scholar] [CrossRef] [Scilit]
- Tiyasha; Tung, T.M.; Yaseen, Z.M. Deep learning for prediction of water quality index classification: Tropical catchment environmental assessment. Nat. Resour. Res. 2021, 30, 4235–4254. [Google Scholar] [CrossRef] [Scilit]
- Palkar, S.; Usgaonkar, S.; Ansari, S. Wq-Net: A deep neural network model for water quality prediction. In Proceedings of the OCEANS 2022, Chennai, India, 21–24 February 2022; pp. 1–6. [Google Scholar]
- Dong, Q.; Lin, Y.; Bi, J.; Yuan, H. An integrated deep neural network approach for large-scale water quality time series prediction. In Proceedings of the 2019 IEEE International Conference on Systems, Man and Cybernetics (SMC), Bari, Italy, 6–9 October 2019; pp. 3537–3542. [Google Scholar]
- Kogekar, A.P.; Nayak, R.; Pati, U.C. A CNN-BiLSTM-SVR based deep hybrid model for water quality forecasting of the river Ganga. In Proceedings of the 2021 IEEE 18th India Council International Conference (INDICON), Guwahati, India, 19–21 December 2021; pp. 1–6. [Google Scholar]
- Jiang, Y.; Li, C.; Sun, L.; Guo, D.; Zhang, Y.; Wang, W. A deep learning algorithm for multi-source data fusion to predict water quality of urban sewer networks. J. Clean. Prod. 2021, 318, 128533. [Google Scholar] [CrossRef] [Scilit]
- Zhu, Q.; Yu, X.; Zhao, L.; Xu, L. A hybrid deep learning model for water quality prediction. IEEE Access 2025, 13, 106406–106415. [Google Scholar] [CrossRef] [Scilit]
- Solanki, A.; Agrawal, H.; Khare, K. Predictive analysis of water quality parameters using deep learning. Int. J. Comput. Appl. 2015, 125, 0975–8887. [Google Scholar] [CrossRef] [Scilit]
- El-Shebli, M.; Sharrab, Y.; Al-Fraihat, D. Prediction and modeling of water quality using deep neural networks. Environ. Dev. Sustain. 2024, 26, 11397–11430. [Google Scholar] [CrossRef] [Scilit]
- Kumpel, E.; Nelson, K.L. Comparing microbial water quality in an intermittent and continuous piped water supply. Water Res. 2013, 47, 5176–5188. [Google Scholar] [CrossRef] [Scilit]
- Stocker, M.D.; Pachepsky, Y.A.; Hill, R.L. Prediction of E. coli concentrations in agricultural pond waters: Application and comparison of machine learning algorithms. Front. Artif. Intell. 2022, 4, 768650. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Weller, D.L.; Love, T.M.; Wiedmann, M. Interpretability versus accuracy: A comparison of machine learning models built using different algorithms, performance measures, and features to predict E. coli levels in agricultural water. Front. Artif. Intell. 2021, 4, 628441. [Google Scholar] [CrossRef] [Scilit]
- Sokolova, E.; Ivarsson, O.; Lillieström, A.; Speicher, N.K.; Rydberg, H.; Bondelind, M. Data-driven models for predicting microbial water quality in the drinking water source using E. coli monitoring and hydrometeorological data. Sci. Total Environ. 2022, 802, 149798. [Google Scholar] [CrossRef] [Scilit]
- Abimbola, O.P.; Mittelstet, A.R.; Messer, T.L.; Berry, E.D.; Bartelt-Hunt, S.L.; Hansen, S.P. Predicting Escherichia coli loads in cascading dams with machine learning: An integration of hydrometeorology, animal density and grazing pattern. Sci. Total Environ. 2020, 722, 137894. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Khan, F.M.; Gupta, R.; Sekhri, S. Superposition learning-based model for prediction of E. coli in groundwater using physico-chemical water quality parameters. Groundw. Sustain. Dev. 2021, 13, 100580. [Google Scholar] [CrossRef] [Scilit]
- Iyer, V. Forecasting Urban Water Escherichia coli Contamination Using Machine Learning Models. EarthArXiv 2024. [Google Scholar] [CrossRef] [Scilit]
- Nafsin, N.; Li, J. Prediction of total organic carbon and E. coli in rivers within the Milwaukee River basin using machine learning methods. Environ. Sci. Adv. 2022, 2, 278–293. [Google Scholar] [CrossRef] [Scilit]
- Graham, P.M. Modelling the Water Quality in Dams Within the Umgeni Water Operational Area with Emphasis on Algal Relations. Doctoral Dissertation, North-West University, Potchefstroom, South Africa, 2007. [Google Scholar]
- Makaba, T.; Dogo, E. A comparison of strategies for missing values in data on machine learning classification algorithms. In Proceedings of the 2019 International Multidisciplinary Information Technology and Engineering Conference (IMITEC), Vanderbijlpark, South Africa, 21–22 November 2019; pp. 1–7. [Google Scholar]
- Juna, A.; Umer, M.; Sadiq, S.; Karamti, H.; Eshmawi, A.A.; Mohamed, A.; Ashraf, I. Water quality prediction using KNN imputer and multilayer perceptron. Water 2022, 14, 2592. [Google Scholar] [CrossRef] [Scilit]
- Roshan, S.P.; Edwin, E.B.; Thanka, M.R.; Ebenezer, V.; Joy, R.P. XGBoost Based Machine Learning Techniques for Water Quality Prediction. In Proceedings of the 2023 International Conference on Circuit Power and Computing Technologies (ICCPCT), Kollam, India, 10–11 August 2023; pp. 364–369. [Google Scholar]
- Rahu, M.A.; Chandio, A.F.; Aurangzeb, K.; Karim, S.; Alhussein, M.; Anwar, M.S. Toward design of internet of things and machine learning-enabled frameworks for analysis and prediction of water quality. IEEE Access 2023, 11, 101055–101086. [Google Scholar] [CrossRef] [Scilit]
- Ogutu, J.O.; Piepho, H.P.; Schulz-Streeck, T. A comparison of random forests, boosting and support vector machines for genomic selection. In Proceedings of the BMC Proceedings, Dublin, Ireland, 4–5 November 2011; Volume 5, p. 3. [Google Scholar]
- Di Nunno, F.; Zhu, S.; Ptak, M.; Sojka, M.; Granata, F. A stacked machine learning model for multi-step ahead prediction of lake surface water temperature. Sci. Total Environ. 2023, 890, 164323. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Motevalli, A.; Naghibi, S.A.; Hashemi, H.; Berndtsson, R.; Pradhan, B.; Gholami, V. Inverse method using boosted regression tree and k-nearest neighbor to quantify effects of point and non-point source nitrate pollution in groundwater. J. Clean. Prod. 2019, 228, 1248–1263. [Google Scholar] [CrossRef] [Scilit]
- Chen, T.; Guestrin, C. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd ACM Sigkdd International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar]
- Shahani, N.M.; Zheng, X.; Liu, C.; Hassan, F.U.; Li, P. Developing an XGBoost regression model for predicting young’s modulus of intact sedimentary rocks for the stability of surface and subsurface structures. Front. Earth Sci. 2021, 9, 761990. [Google Scholar] [CrossRef] [Scilit]
- Gill, K.S.; Tuteja, G.; Anand, V.; Gupta, R.; Hsiung, P.A. Water quality prediction using classification techniques on xgboost, kneighbors, svc, random forest, adaboost, and gaussiannb classifier. In Proceedings of the 2023 Global Conference on Information Technologies and Communications (GCITC), Bengaluru, India, 1–3 December 2023; pp. 1–4. [Google Scholar]
- Nagarajan, G.; Reddy, N.K.; Kumar, Y.V.; Reddy, A.R.; Chandu, T. Water Quality Classification Using XG Boost. In Proceedings of the 2024 International Conference on Trends in Quantum Computing and Emerging Business Technologies, Lavasa, India, 21–22 March 2024; pp. 1–3. [Google Scholar]
- Yusri, H.I.H.; Ab Rahim, A.Z.A.; Hassan, S.L.M.; Halim, I.S.A.; Abdullah, N.E. Water quality classification using SVM and XGBoost method. In Proceedings of the 2022 IEEE 13th Control and System Graduate Research Colloquium (ICSGRC), Shah Alam, Malaysia, 23 July 2022; pp. 231–236. [Google Scholar]
- Aslam, B.; Maqsoom, A.; Cheema, A.H.; Ullah, F.; Alharbi, A.; Imran, M. Water quality management using hybrid machine learning and data mining algorithms: An indexing approach. IEEE Access 2022, 10, 119692–119705. [Google Scholar] [CrossRef] [Scilit]
- Bisht, A.K.; Singh, R.; Bhutiani, R.; Bhatt, A. Artificial neural network based predictionmodel forestimating the water quality of the river Ganga. In Proceedings of the 2017 3rd International Conference on Advances in Computing, Communication and Automation (ICACCA) (Fall), Dehradun, India, 15–16 September 2017; pp. 1–5. [Google Scholar]
- Khan, Y.; Chai, S.S. Ensemble of ANN and ANFIS for water quality prediction and analysis-a data driven approach. J. Telecommun. Electron. Comput. Eng. (JTEC) 2017, 9, 117–122. [Google Scholar]
- Mallik, S.; Chakraborty, A.; Mishra, U.; Paul, N. Prediction of irrigation water suitability using geospatial computing approach: A case study of Agartala city, India. Environ. Sci. Pollut. Res. 2023, 30, 116522–116537. [Google Scholar] [CrossRef] [Scilit]
- Hong, S.M.; Morgan, B.J.; Stocker, M.D.; Smith, J.E.; Kim, M.S.; Cho, K.H.; Pachepsky, Y.A. Using machine learning models to estimate Escherichia coli concentration in an irrigation pond from water quality and drone-based RGB imagery data. Water Res. 2024, 260, 121861. [Google Scholar] [CrossRef] [Scilit]
- Kuroki, S.; Ogata, R.; Sakamoto, M. Predicting the presence of E. coli in tap water using machine learning in Nepal. Water Environ. J. 2023, 37, 402–411. [Google Scholar] [CrossRef] [Scilit]
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. |
© 2025 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.





