# Training and Testing Data Division Influence on Hybrid Machine Learning Model Process: Application of River Flow Forecasting

Authors: Hai Tao; Ali Omran Al-Sulttani; Ameen Mohammed Salih Ameen; Zainab Hasan Ali; Nadhir Al-Ansari; Sinan Q. Salih; Reham R. Mostafa
Journal: Complexity
 (2020)

---

## Abstract

The hydrological process has a dynamic nature characterised by randomness and complex phenomena. The application of machine learning (ML) models in forecasting river flow has grown rapidly. This is owing to their capacity to simulate the complex phenomena associated with hydrological and environmental processes. Four different ML models were developed for river flow forecasting located in semiarid region, Iraq. The effectiveness of data division influence on the ML models process was investigated. Three data division modeling scenarios were inspected including 70%–30%, 80%–20, and 90%–10%. Several statistical indicators are computed to verify the performance of the models. The results revealed the potential of the hybridized support vector regression model with a genetic algorithm (SVR-GA) over the other ML forecasting models for monthly river flow forecasting using 90%–10% data division. In addition, it was found to improve the accuracy in forecasting high flow events. The unique architecture of developed SVR-GA due to the ability of the GA optimizer to tune the internal parameters of the SVR model provides a robust learning process. This has made it more efficient in forecasting stochastic river flow behaviour compared to the other developed hybrid models.


---

## Body

## 1. Introduction

The hydrological, environmental, and climatological processes related to different components of the hydrologic cycle such as rainfall, evaporation, infiltration, groundwater, and river flow are embedded with high nonlinearity, nonstationery, and redundancy [1, 2]. Mathematical models are generally used to address the different forms of nonlinearity and model different hydrological processes [3, 4]. A large number of hydrological models have been developed and successfully applied for forecasting different components of hydrological cycles [5]. Among them, the hydrological model for forecasting river flow has received the highest attention due to its enormous importance [6]. Being that river flow pattern is difficult to be fully understood due to the temporal and spatial changes in basin characteristics and variabilities in the rainfall-runoff process, univariate river flow simulation has become a trending topic in the field of hydrology [7]. River flow modeling in a particular climate environment (e.g., semiarid) is highly complicated as it is associated with regional climate and human interventions. Significant changes in climate have been witnessed across the globe in recent years. Streamflow time series is dynamic, complex, and presenting nonlinear and randomness phenomena. These characteristics make the forecasting process challenging for most of the hydrological researchers [8, 9]. Accurate long-term forecasting of river flow at monthly and yearly scale is very important for the planning and operation of water reservoir, agricultural and irrigation water management, estimation of catchment water balance, estimating minimum instream environmental flow, and other purposes [10, 11]. The accurate short-term (real-time) forecasting of river flow such as hourly or daily time step is important for flood and/or water scarcity forecasting in order to minimize and mitigate their effects on infrastructure and public health [12]. In addition, this river flow forecast makes it possible to predict the minimum instream environmental flow that is primarily used to sustain organisms’ reproduction and growth and provide optimum habitat area [13].Several developments have been recorded over the years in the application of machine learning (ML) models, artificial intelligence (AI) models, and big data mining technology for the solution of related hydrological engineering problems [14–18]. Being that these models do not depend on a physical meaning, they are suitable for solving problems, which are influenced by several complex factors, such as nonlinear natural processes and forecasting problems [19]. These models have also been found suitable for the solution of hydrological problems [20]. The ML models, unlike the physically based models, can mimic the actual trend of hydrological time series data by autonomously learning the various hydrological processes. However, ML models need a low level of expertise for the implementation and they can provide a fast solution compared to physically based models.Despite the suitability of the ML models in hydrological studies, they are still prone to several drawbacks, such as prolonged computation time and insufficient feature extraction capability [21]. The recent interest in the ML models has exposed many other drawbacks of the classical ML models like artificial neural network (ANN), support vector regression (SVR), adaptive neurofuzzy inference (ANFIS), and random forest (RF) [22], which include trapping at local optima and gradient disappearance. Therefore, exploration of new robust and reliable versions of ML models for the modeling of various hydrological phenomena is always the motivation of hydrologists and soft computing scientists [20]. Recently, the new era of ML models is configured in the form of hybridized models where in integral of tuning parameter algorithms, it is conducted for solving the internal parameters using some bioinspired or mathematical optimizers. The hybrid ML model has been emerged as the sought-after model due to its capability to overcome the drawbacks of standalone ML models [23]. It has been successfully applied in recent years for complex hydrological problems [24, 25].The traditional ML models can build their learning processes using trial and error procedure that is associated with the possibility of the limited learning process. Hence, introducing the new optimization approaches can solve this problem and provide a reliable and robust learning mechanism. Risks associated with flooding can be reduced via accurate modeling of river flow time series dynamics. This can also enhance the capability of proper management of reservoirs during droughts [26]. The accurate forecasting of river flow time series should preferably be based on the existing long data with memory networks. Hybrid ML models as a robust methodology provide an excellent learning memory that could better model river flow patterns and provide better forecasting. During training the predictive model, the data is divided into the training and testing phase. A low ratio of training data may decrease the performance of the model, whereas the high ratio leads to overfitting. In both cases, the models get bad performance and unacceptable results. So, choosing the best ratio of data division is considered a challenging task in developing a machine learning model [27].The main objective of the present study is to investigate the impact of training and testing data divisions on the process of several hybrid ML models including hybridized ANN and SVR with genetic algorithm (GA) and hybridized SVR and RF with the grid search algorithm. The development of the introduced models is investigated for river flow forecasting using historical data, which belongs to the Tigris River in semiarid climate of Iraq. The capacity of the developed model is examined to solve the complexity of river flow by using statistical metrics and graphical presentation.The modeling procedure is structured based on different antecedent values of river flow and is defined as the matrix attributes for univariate modeling. Three data division scenarios for the training and testing dataset were inspected. The obtained results are discussed comprehensively and analysed comparatively to reveal the forecasting ability of different models. Thereafter, the forecasted river flow was used to estimate minimum instream environmental flow that is primarily used to sustain organisms’ reproduction and growth and provide optimum habitat area.


## 2. Description of Study Areas and Data

The Tigris River is one of the largest rivers in Middle East. The total length of the river is about 1718 km which is shared by Turkey, Syria, and Iraq. About 85% of the total basin of Tigris River (253,000 km) lies in Iraq. The Tigris River along with the Euphrates River supplies the major share of total water required for irrigation, human use, and industrial purposes for several cities in Iraq, Turkey, and Iran counties. The climate of the basin is predominantly arid; however, semiaridity is the main characteristic of the river. The average rainfall in the basin is 216 mm with most of the rainfall occurring during winter (December to February) [28]. However, the rainfall concentration is varied from the north, middle, and south of Iraq [29]. The temperature varies from maximum 45°C during summer to minimum 10°C in winter [29]. The monthly river flow data of Tigris River for the period January 1991 to November 2010 was obtained from the USGS Data Series 540 for the present study [30]. The mean monthly discharge and the standard deviation of Tigris River flow at Baghdad Station are 411.35 m3/s and 234.52 m3/s, respectively [31]. The location of Tigris River in the map of Iraq is presented in Figure 1.Figure 1
The location of the case study on Tigris River, Iraq.


## 3. Data Division Scenarios and Input Combinations

In order to utilize the machine learning methods for forecasting, the observed river flow data was split into two sets (training and testing). Three data divisions were inspected in this research including 70%–30%, 80%–20, and 90%–10%. This is owing to the fact that ML models can behave differently based on the supplied dataset span for the learning process and testing phases [32].The identification of the input parameters for the ML model’s development is an essential step prior to the models’ learning process. In this study, as the intended is the river flow forecasting, lead times were determined using the statistical approaches including the autocorrelation function (ACF) and the partial autocorrelation function (PACF). The suitable input parameters were decided based on the highly influential lead times toward the one-step-ahead forecasting. Valuable temporal pattern may exist in observed data which can be used as an input pattern for the development of the forecasting model. ACF can be used to capture information on the temporal patterns existing in time series. ACF provides information about the correlation between two separate points on the time series at different time leads and provides information about the repeating patterns in the time series. Thus, it tells how the past river flow influences the future river flow.The ACF value ranges between 1 and −1; the value near to 1 indicates near-perfect correlation and the value near to −1 indicates complete anticorrelation. However, the time series data for the river flow is time-independent, and therefore, the correlation between the pair of values depends only on the time differences between the two points without considering their position in the series. In order to distinguish the most appropriate lead times of the time series that notably or substantially might influence the forecasting, the reference value of ACF should be identified. In this study, the ACF values equal to or more than 0.5 were considered for the selection of the time-lag pattern [33, 34]. Figure 2 illustrates the ACF values for different lead times up to 20 time differences. Figure 2 shows that the ACF values for Tigris River for the lead times Qt−1 to Qt−5 are more than 0.2. In other words, five input combinations were constructed (Model I, Model II, … , Model V).Figure 2
The statistics of the autocorrelation function (ACF) and the partial autocorrelation function (PACF) for the studied time series river flow.


## 4. Machine Learning Models Overview

In this study, four different hybrid machine learning models were developed including ANN-GA, SVR-GA, Grid-SVR, and Grid-RF for monthly river flow forecasting located in semiarid region, Iraq. RapidMiner software was used to develop machine learning models. RapidMiner is an open-source, free, and flexible software implemented by Java language. The program has been used in data analysis, application design, and developing complex models [35]. The development of predictive models using the above hybrid ML models is described in the following sections.


### 4.1. ANN-GA

Inspired by the human neural network, ANN was proposed and developed to simulate the human brain during learning. With high computing power, ANN can outperform the performance of the human in some cases. ANN was applied for solving many regression, clustering, and classification tasks.ANN, as shown in Figure3, consists of three types of layers: input layer, hidden layer, and output layer [36]. Each layer consists of a set of nodes called artificial neurons that perform elementary calculations [37]. Weighted connections connect neurons in the successive layers. During the training procedure of ANN, weights are defined and updated with the aim of minimizing the error between the actual output and the computed output. ANN has the ability to produce output with reasonable accuracy [38], if it has gone through an effective learning phase.Figure 3
ANN architecture.The backpropagation neural network (BPNN) proposed by Rumelhart et al. [39] is one of the most popular learning algorithms. BP aims to optimize the network parameters by minimizing the least square error between actual and computed output.Inspired by Darwin’s theory of biological evolution, GA was developed as a heuristic method for finding the function’s optimal value [40, 41]. It represents one of the most popular forms of an evolutionary algorithm used to solve different optimization problems [42, 43]. GA is initialized by generating a random population of individuals (solutions) and tries to optimize these individuals by applying three successive operations:(i)
Selection of the best individuals with high fitness values.(ii)
The crossover between two individuals to generate a new population.(iii)
The mutation performed by introducing random changes in individuals.This procedure is repeated a certain number of times until the optimum values are obtained. In this section, the performance of BP was optimized using GA for tuning the parameters that affect the NN’s performance. The training procedure for BP starts by using GA to perform a global search for network weight values. It refines an initially random set of weights to get a better estimate, and it is likely to be close to the global optimum [44, 45]. After that comes the role of BP in training in order to refine the solution provided by the GA to bring it to the optimum solution.The general steps of ANN-GA can be summarized as follows. The flowchart of the GA-ANN method is illustrated in Figure4. Initially, a feasible NN’s topology was predefined through determining the number of neurons in the hidden layer [46, 47]. After that, steps to improve the performance of neural networks through GA algorithms begin as follows:Step 1: initialize the random values for weight and bias (wij and bi) according to initial network topology.Step 2: generate an initial random population of parameters. Then perform the following steps until reaching the maximum number of iterations:Step 2.1: calculate the fitness value by applying the fitness function on each individual in the population.Step 2.2: update the network parameters (wij and bi) based on the lowest error E.Step 2.3: generate a new population through performing GA operations: selection, crossover, and mutation.Step 3: obtain the optimal value of parameters from the last populationStep 4: train NN by PB training procedure (updating final weight and bias).Step 5: evaluate the performance of NN using testing data. If the error is acceptable, stop and return the optimal model; otherwise, change the network topology (number of hidden layer’s neurons) and return to step 1.Figure 4
Flow diagram of ANN-GA model.


### 4.2. RF-Grid

Grid search is a traditional way for performing hyperparameters optimization for ML models. It is simply an exhaustive search method that sets up a grid of the possible values of the hyperparameters (Figure5) and trains a model for each of the combinations [48]. In this method, all the possible combinations of the data are tried and tested using k-fold cross-validation technique.Figure 5
Grid search method.Random forest (RF) is one of the most potent ensemble learning techniques developed by Breiman in 2001 [49] to solve different regression, classification, and clustering problem, and it exhibited excellent performance in many fields [50–52].Despite the advantages of decision trees of its simplicity, ease of use, and interpretability [53, 54], it has many limitations, such as their suboptimal performance and lack of robustness. Therefore, RF can overcome the limitations of traditional decision trees by combining the performance of many randomized, decorrelated decision trees to predict or classify the variable to a specific class. RF is a boosting technique in which it boosted the performance of a number of decision trees via a voting scheme. An example of RF is shown in Figure 6 in which the forest consists of n trees and a voter.Figure 6
Example of random forest (RF) algorithm.Regarding the main advantages of RF in regression tasks, it includes (i) bootstrap resampling, (ii) random features selection, and (iii) out-of-bag error estimation.Suppose there aren trees T1X,T2X,…,TnX, where X=x1,x2,…,xm is a m-dimension vector of inputs. The prediction value of each decision tree is Y^i=Tix. While the final prediction output Y results from aggregating the outputs of all randomly generated trees. The aggregation process is accomplished in the classification task by taking the majority votes, while in regression task, it is accomplished by taking the average:(1)Y=∑i=1nY^ix=1n∑i=1nTix.The RF algorithm can be summarized as follows [55, 56]:(i)
Generaten number of trees by selecting randomly different bootstrap samples from the training data. The out-of-bag samples are the samples that are not selected.(ii)
For each bootstrap sample, grow a full decision tree to the maximum size without pruning. In splitting the nodes of the tree, a specific number of features were selected randomly instead of choosing all features (this refers to a random feature selection).(iii)
Repeat step 2 until forming a randomly generated forest consisting ofn decision trees.(iv)
Predict the new data by applying then trees and aggregate the results.In this section, the grid search algorithm was used to optimize the RF algorithm by tuning the hyperparameters of it. The primary hyperparameters of RF that affect its performance are (1) the number of trees in the forest that must be generated before taking the maximum voting or average of predictions and (2) the maximum number of features to split in each node of the tree. The hybrid structure of RF and grid search was considered in the following steps (Figure7):(i)
Step 1: define RF searching parameters range: maximum value, minimum value, and step size.(ii)
Step 2: build the grid search space on the coordinate system.(iii)
Step 3: build the RF models using all possible combinations of parameters and evaluate the performance of RF.(iv)
Step 4: return the multiple set of optimal parameters.(v)
Step 5: if the accuracy is satisfied, stop and return the optimal parameters; otherwise go to step 6.(vi)
Step 6: redefine the range of searching near the optimal parameters and reduce step size. Then, go to step 2.(vii)
Step 7: repeat steps 2–6 until the optimal hyperparameters values satisfying the accuracy were found.(viii)
Step 8: build RF forest model with the optimal parameters.(ix)
Step 9: predict the output value of data in testing set by RF model.Figure 7
Flowchart of RF-grid model.


### 4.3. SVR-GA

Support vector regression (SVR) is introduced by Vapnik [57] as an extension of SVM for solving the regression problem. SVR is a very useful tool for prediction because of its ability to map nonlinear data space into a higher dimensional feature space [58].Consider a learning dataset defined asxi,yii=1,…,n, where xi∈Rn is the input vector and yi∈R is its corresponding output vector. The main objective of SVR is to deduce the regression function f (x) that describes the relationship between the input data x and the target output y with an error value that is less than epsilon ε deviation for all training data.The SVR function can be written as follows [59]:(2)fx=wTφx+b,where fx is the computed output of x, φx is the nonlinear feature mapping function of inputs, and w and b are adjustable coefficients that represent the weight vector and intercept vector, respectively. The training of SVR is to find w and b values by minimizing the upper bound of the regression error.Therefore, SVR is considered as an optimization problem that tries to make the regression functionfx as flat as possible by minimizing the value of w, which necessitates the minimization of Euclidean norm, that is, w2.The optimization problem that is used to identify the regression problem is given as follows:(3)minimize12w2subject toyi−wTφx−b≤ε−yi+wTφx+b≤ε.The preceding equation applies if there is functionf (x) which approximates all pairs of xi,yi with an accuracy of ε. Besides, some mistakes that violate the conditions above are introduced. The inaccessible limitations of the optimization problem are addressed by the slack variables ξi and ξi∗. Equation (2) can, therefore, be rewritten as explained as follows:(4)minimize12w2+C∑i=1lξi+ξi∗subject toyi−wTφx−b≤ε+ξi−yi+wTφx+b≤ε+ξi∗,ξi,ξi∗≥0,i=1,2,…,n,where C is defined as a nonnegative constant which expresses the box constraint that is responsible for monitoring data points above the ε-insensitive error range and which is also helpful when avoiding overfitting problems [58]. There are several commonly used kernel types in SVR that convert the nonlinear function in equation (1) into higher dimensional space. The radial basis function (RBF) has been widely used in previous studies [5, 60]:(5)fx=wTKx,xi+b,Kx,xi=exp−x−xi22γ2,where Kx,xi is the kernel function and γ is the width parameter.The performance of the SVR model depends on the hyperparameter tuning of the model: the regularization parameter (C), the epsilon (ε), and the kernel parameter (γ). These parameter values affect the performance of the model incredibly, in which the influence of these parameter values is presented as follows. The value of the first parameter (i.e., regularization parameter, also called box constraints) is used to decide the penalty of the approximation function. It must not be very small or large. If it is too small (large), it will cause underfitting (overfitting). In contrast, the decision boundary’s maximum margin is controlled by the insensitivity loss function (ε). Finally, the kernel function controls the ability to make the model for dealing with nonlinear function responsible for transforming the nonlinear function into a more suitable function [61, 62].Many researches were conducted to tune the hyperparameters of SVR using manual or grid search [63, 64]. However, this approach’s complexity is increased incredibly when the width of the search space is increased. Also, this approach does not always get the best hyperparameter values for the model. Other approaches have been inspired to overcome these limitations, that is, the genetic algorithm (GA). GA is considered one of the power optimization algorithms proposed by Holland in 1975 and inspired by Darwin’s theory. In this section, GA is inspired and used to find the hyperparameter of SVR. The proceeding procedure of optimizing SVR hyperparameters using GA was illustrated in Figure 8, and the steps involved are summarized as follows:Step 1: initialize the SVR parametersε,C and the kernel parameters γ. Code these parameters to create a chromosome directly.Step 2: initialize the GA parameters randomly: population size, number of generations, mutation rate, and crossover rate.Step 3: perform SVR model on training data using thek-fold cross validation.Step 4: calculate the fitness value of each individual in the population according to the mean square error (MSE).Step 5: generate new offspring parameters population through selection, crossover, and mutation.Step 6: repeat steps 4-5 untilε,C,γ are satisfied with minimal error; otherwise, continue to optimize.Step 7: output the optimal parameters found at the end of the generation. Train SVR model with these parametersStep 8: predict the out of data in the testing dataset part by SVR model.Figure 8
The flowchart of SVR-GA model.


### 4.4. SVR-Grid

In this section, the grid search algorithm is used to obtain the optimal values of the SVR parameters (ε, C, and g). The grid search algorithm is based on trying all possible values of the parameters in a given space with a specified step distance. The cross-validation technique [65] derives the SVR model’s parameters that improve its performance with the best accuracy.The hybrid structure of SVR optimized by grid search is illustrated through a flowchart, as shown in Figure9, and consists of the following steps:Step 1: define the range of SVR searching parameters.Step 2: initialize the values of the parameters and step distance.Step 3: split dataset into two sets (training and testing sets)Step 4: train SVR model usingk-fold cross validation on the training dataset.Step 5: if the MSE satisfies the accuracy, then select the sets of parameters with the minimum MSE; otherwise, continue the optimize and go to step 5.Step 6: search for multiple sets of optimal parameters.Step 7: redefine the range of searching near the optimal parameters and reduce the search step; then go to step 4.Figure 9
The flowchart of SVR-grid model.


## 4.1. ANN-GA

Inspired by the human neural network, ANN was proposed and developed to simulate the human brain during learning. With high computing power, ANN can outperform the performance of the human in some cases. ANN was applied for solving many regression, clustering, and classification tasks.ANN, as shown in Figure3, consists of three types of layers: input layer, hidden layer, and output layer [36]. Each layer consists of a set of nodes called artificial neurons that perform elementary calculations [37]. Weighted connections connect neurons in the successive layers. During the training procedure of ANN, weights are defined and updated with the aim of minimizing the error between the actual output and the computed output. ANN has the ability to produce output with reasonable accuracy [38], if it has gone through an effective learning phase.Figure 3
ANN architecture.The backpropagation neural network (BPNN) proposed by Rumelhart et al. [39] is one of the most popular learning algorithms. BP aims to optimize the network parameters by minimizing the least square error between actual and computed output.Inspired by Darwin’s theory of biological evolution, GA was developed as a heuristic method for finding the function’s optimal value [40, 41]. It represents one of the most popular forms of an evolutionary algorithm used to solve different optimization problems [42, 43]. GA is initialized by generating a random population of individuals (solutions) and tries to optimize these individuals by applying three successive operations:(i)
Selection of the best individuals with high fitness values.(ii)
The crossover between two individuals to generate a new population.(iii)
The mutation performed by introducing random changes in individuals.This procedure is repeated a certain number of times until the optimum values are obtained. In this section, the performance of BP was optimized using GA for tuning the parameters that affect the NN’s performance. The training procedure for BP starts by using GA to perform a global search for network weight values. It refines an initially random set of weights to get a better estimate, and it is likely to be close to the global optimum [44, 45]. After that comes the role of BP in training in order to refine the solution provided by the GA to bring it to the optimum solution.The general steps of ANN-GA can be summarized as follows. The flowchart of the GA-ANN method is illustrated in Figure4. Initially, a feasible NN’s topology was predefined through determining the number of neurons in the hidden layer [46, 47]. After that, steps to improve the performance of neural networks through GA algorithms begin as follows:Step 1: initialize the random values for weight and bias (wij and bi) according to initial network topology.Step 2: generate an initial random population of parameters. Then perform the following steps until reaching the maximum number of iterations:Step 2.1: calculate the fitness value by applying the fitness function on each individual in the population.Step 2.2: update the network parameters (wij and bi) based on the lowest error E.Step 2.3: generate a new population through performing GA operations: selection, crossover, and mutation.Step 3: obtain the optimal value of parameters from the last populationStep 4: train NN by PB training procedure (updating final weight and bias).Step 5: evaluate the performance of NN using testing data. If the error is acceptable, stop and return the optimal model; otherwise, change the network topology (number of hidden layer’s neurons) and return to step 1.Figure 4
Flow diagram of ANN-GA model.


## 4.2. RF-Grid

Grid search is a traditional way for performing hyperparameters optimization for ML models. It is simply an exhaustive search method that sets up a grid of the possible values of the hyperparameters (Figure5) and trains a model for each of the combinations [48]. In this method, all the possible combinations of the data are tried and tested using k-fold cross-validation technique.Figure 5
Grid search method.Random forest (RF) is one of the most potent ensemble learning techniques developed by Breiman in 2001 [49] to solve different regression, classification, and clustering problem, and it exhibited excellent performance in many fields [50–52].Despite the advantages of decision trees of its simplicity, ease of use, and interpretability [53, 54], it has many limitations, such as their suboptimal performance and lack of robustness. Therefore, RF can overcome the limitations of traditional decision trees by combining the performance of many randomized, decorrelated decision trees to predict or classify the variable to a specific class. RF is a boosting technique in which it boosted the performance of a number of decision trees via a voting scheme. An example of RF is shown in Figure 6 in which the forest consists of n trees and a voter.Figure 6
Example of random forest (RF) algorithm.Regarding the main advantages of RF in regression tasks, it includes (i) bootstrap resampling, (ii) random features selection, and (iii) out-of-bag error estimation.Suppose there aren trees T1X,T2X,…,TnX, where X=x1,x2,…,xm is a m-dimension vector of inputs. The prediction value of each decision tree is Y^i=Tix. While the final prediction output Y results from aggregating the outputs of all randomly generated trees. The aggregation process is accomplished in the classification task by taking the majority votes, while in regression task, it is accomplished by taking the average:(1)Y=∑i=1nY^ix=1n∑i=1nTix.The RF algorithm can be summarized as follows [55, 56]:(i)
Generaten number of trees by selecting randomly different bootstrap samples from the training data. The out-of-bag samples are the samples that are not selected.(ii)
For each bootstrap sample, grow a full decision tree to the maximum size without pruning. In splitting the nodes of the tree, a specific number of features were selected randomly instead of choosing all features (this refers to a random feature selection).(iii)
Repeat step 2 until forming a randomly generated forest consisting ofn decision trees.(iv)
Predict the new data by applying then trees and aggregate the results.In this section, the grid search algorithm was used to optimize the RF algorithm by tuning the hyperparameters of it. The primary hyperparameters of RF that affect its performance are (1) the number of trees in the forest that must be generated before taking the maximum voting or average of predictions and (2) the maximum number of features to split in each node of the tree. The hybrid structure of RF and grid search was considered in the following steps (Figure7):(i)
Step 1: define RF searching parameters range: maximum value, minimum value, and step size.(ii)
Step 2: build the grid search space on the coordinate system.(iii)
Step 3: build the RF models using all possible combinations of parameters and evaluate the performance of RF.(iv)
Step 4: return the multiple set of optimal parameters.(v)
Step 5: if the accuracy is satisfied, stop and return the optimal parameters; otherwise go to step 6.(vi)
Step 6: redefine the range of searching near the optimal parameters and reduce step size. Then, go to step 2.(vii)
Step 7: repeat steps 2–6 until the optimal hyperparameters values satisfying the accuracy were found.(viii)
Step 8: build RF forest model with the optimal parameters.(ix)
Step 9: predict the output value of data in testing set by RF model.Figure 7
Flowchart of RF-grid model.


## 4.3. SVR-GA

Support vector regression (SVR) is introduced by Vapnik [57] as an extension of SVM for solving the regression problem. SVR is a very useful tool for prediction because of its ability to map nonlinear data space into a higher dimensional feature space [58].Consider a learning dataset defined asxi,yii=1,…,n, where xi∈Rn is the input vector and yi∈R is its corresponding output vector. The main objective of SVR is to deduce the regression function f (x) that describes the relationship between the input data x and the target output y with an error value that is less than epsilon ε deviation for all training data.The SVR function can be written as follows [59]:(2)fx=wTφx+b,where fx is the computed output of x, φx is the nonlinear feature mapping function of inputs, and w and b are adjustable coefficients that represent the weight vector and intercept vector, respectively. The training of SVR is to find w and b values by minimizing the upper bound of the regression error.Therefore, SVR is considered as an optimization problem that tries to make the regression functionfx as flat as possible by minimizing the value of w, which necessitates the minimization of Euclidean norm, that is, w2.The optimization problem that is used to identify the regression problem is given as follows:(3)minimize12w2subject toyi−wTφx−b≤ε−yi+wTφx+b≤ε.The preceding equation applies if there is functionf (x) which approximates all pairs of xi,yi with an accuracy of ε. Besides, some mistakes that violate the conditions above are introduced. The inaccessible limitations of the optimization problem are addressed by the slack variables ξi and ξi∗. Equation (2) can, therefore, be rewritten as explained as follows:(4)minimize12w2+C∑i=1lξi+ξi∗subject toyi−wTφx−b≤ε+ξi−yi+wTφx+b≤ε+ξi∗,ξi,ξi∗≥0,i=1,2,…,n,where C is defined as a nonnegative constant which expresses the box constraint that is responsible for monitoring data points above the ε-insensitive error range and which is also helpful when avoiding overfitting problems [58]. There are several commonly used kernel types in SVR that convert the nonlinear function in equation (1) into higher dimensional space. The radial basis function (RBF) has been widely used in previous studies [5, 60]:(5)fx=wTKx,xi+b,Kx,xi=exp−x−xi22γ2,where Kx,xi is the kernel function and γ is the width parameter.The performance of the SVR model depends on the hyperparameter tuning of the model: the regularization parameter (C), the epsilon (ε), and the kernel parameter (γ). These parameter values affect the performance of the model incredibly, in which the influence of these parameter values is presented as follows. The value of the first parameter (i.e., regularization parameter, also called box constraints) is used to decide the penalty of the approximation function. It must not be very small or large. If it is too small (large), it will cause underfitting (overfitting). In contrast, the decision boundary’s maximum margin is controlled by the insensitivity loss function (ε). Finally, the kernel function controls the ability to make the model for dealing with nonlinear function responsible for transforming the nonlinear function into a more suitable function [61, 62].Many researches were conducted to tune the hyperparameters of SVR using manual or grid search [63, 64]. However, this approach’s complexity is increased incredibly when the width of the search space is increased. Also, this approach does not always get the best hyperparameter values for the model. Other approaches have been inspired to overcome these limitations, that is, the genetic algorithm (GA). GA is considered one of the power optimization algorithms proposed by Holland in 1975 and inspired by Darwin’s theory. In this section, GA is inspired and used to find the hyperparameter of SVR. The proceeding procedure of optimizing SVR hyperparameters using GA was illustrated in Figure 8, and the steps involved are summarized as follows:Step 1: initialize the SVR parametersε,C and the kernel parameters γ. Code these parameters to create a chromosome directly.Step 2: initialize the GA parameters randomly: population size, number of generations, mutation rate, and crossover rate.Step 3: perform SVR model on training data using thek-fold cross validation.Step 4: calculate the fitness value of each individual in the population according to the mean square error (MSE).Step 5: generate new offspring parameters population through selection, crossover, and mutation.Step 6: repeat steps 4-5 untilε,C,γ are satisfied with minimal error; otherwise, continue to optimize.Step 7: output the optimal parameters found at the end of the generation. Train SVR model with these parametersStep 8: predict the out of data in the testing dataset part by SVR model.Figure 8
The flowchart of SVR-GA model.


## 4.4. SVR-Grid

In this section, the grid search algorithm is used to obtain the optimal values of the SVR parameters (ε, C, and g). The grid search algorithm is based on trying all possible values of the parameters in a given space with a specified step distance. The cross-validation technique [65] derives the SVR model’s parameters that improve its performance with the best accuracy.The hybrid structure of SVR optimized by grid search is illustrated through a flowchart, as shown in Figure9, and consists of the following steps:Step 1: define the range of SVR searching parameters.Step 2: initialize the values of the parameters and step distance.Step 3: split dataset into two sets (training and testing sets)Step 4: train SVR model usingk-fold cross validation on the training dataset.Step 5: if the MSE satisfies the accuracy, then select the sets of parameters with the minimum MSE; otherwise, continue the optimize and go to step 5.Step 6: search for multiple sets of optimal parameters.Step 7: redefine the range of searching near the optimal parameters and reduce the search step; then go to step 4.Figure 9
The flowchart of SVR-grid model.


## 5. Data Analysis and Results

### 5.1. Model Performance Evaluation Using Statistical Indices

The effectiveness of the proposed modeling techniques was examined by comparing the forecasted river flow with the observed river flow data. It should be noted that the data used in this investigation was continuous and without any missing value.The performance of the models in forecasting river flow one month ahead was forecasted and evaluated using several statistical metrics. Five statistical metrics were used to measure the performance of the predictive models in forecasting river flow during model testing, namely, Mean Error (ME), Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Percentage Error (MPE), Mean Absolute Percentage Error (MAPE), and Coefficient of Determination (R2) [66, 67]. These statistical metrics were widely used by researchers to evaluate the performance of predictive models in hydrological and machine learning models [68]. These measurements are considered a good indicator of the accuracy and robustness of the model:(6)ME=∑i=1Nyo−ypN,RMSE=∑i=1Nyo−yp2N,MAE=∑i=1Nyo−ypN,MPE=1N∑i=1Nyo−ypyo,MAPE=1N∑i=1Nyo−ypyo,R2=∑i=1Nyo−y¨o∑i=1Nyp−y¨p∑i=1Nyo−y¨o2∑i=1Nyp−y¨p22,where N is the length of the testing data set. yo and yp are the actual and forecasted river flow data. y¨o and y¨p are the mean values of the actual and forecasted river flow data.Tables1–3 present the statistical performance indicators (i.e., ME, RMSE, MAE, MPE, MAPE, and R2) for the five constructed input combinations, training and testing phases, and the three data division scenarios. The tables showed that all the four hybrid ML models (ANN-GA, SVR-GA, Grid-SVR, and Grid-RF) are performed in a general good performance. However, they are varied from one input combination to another. That totally depends on the historical data memory provided by the lead time “antecedent river flow values.” A notable enhancement is achieved using the hybridized SVR-GA which collaborates with the findings of several other studies established over the literature within hydrological engineering [69–72]. It is observed that the data division plays an essential role in the learning process of the developed ML models. Apparently, increasing the span of the training phase contributes to model predictability enhancement. In quantitative terms, the best results of forecasting are attained for the SVR-GA with (RMSE = 0.04, MAE = 0.03, and R2 = 0.95). The SVR-GA model indicated boosting in forecasting accuracy; although, the other ML models obtained a reasonable prediction accuracy. This observation approved the capacity of the hybrid SVR-GA model to solve the complexity of river flow located in semiarid environment. The Coefficient of Determination (R2) was achieved more than 0.90 for almost all the input combinations over the using the SVR-GA model although the performance of the SVR-GA model over the training phase was not superior (Table 3). This can explain the feasibility of the SVR-GA to be more potent.Table 1
The statistical performance metrics for the developed hybrid ML models over the 70–30% modeling data division scenario.
MERMSEMAEMPEMAPER2Model ITraining phaseANN-GA59.32256.43175.66−1261.381549.290.63SVR-GA10.34247.05154.56−862.911285.200.68Grid-RF−2.33123.2477.09−264.95527.5440.92Grid-SVR−15.35254.68159.67−576.681198.010.58Testing phaseANN-GA66.05205.10163.48−1632.741886.530.69SVR-GA7.83157.47124.27−806.191270.950.78Grid-RF−3.25138.48108.65−380.57977.750.80Grid-SVR−5.68128.3291.09−338.22751.280.91Model IITraining phaseANN-GA−33.47331.87211.77−1370.871938.010.46SVR-GA−10.54235.56142.34−664.551183.010.72Grid-RF−7.59116.7571.18205.18490.950.93Grid-SVR−5.96234.96141.50−516.181057.580.72Testing phaseANN-GA13.75194.68137.36−744.311242.380.56SVR-GA11.80133.54108.60−506.76941.080.79Grid-RF−14.79160.42119.92−335.94936.550.73Grid-SVR42.39136.07106.04−782.931098.750.77Model IIITraining phaseANN-GA−44.17245.56150.87−218.53921.870.65SVR-GA−9.11236.37143.78−815.631334.090.72Grid-RF7.27125.0383.15−454.79921.870.91Grid-SVR−33.94273.67174.09−862.271445.520.64Testing phaseANN-GA21.40164.3153124.08−856.111274.740.80SVR-GA27.02142.074115.56−804.351138.050.87Grid-RF0.97143.7111110.28−400.61958.010.82Grid-SVR32.84152.1099105.33−836.431173.840.38Model IVTraining phaseANN-GA21.40164.36124.08−856.111274.740.67SVR-GA27.02142.07115.57−804.351138.050.69Grid-RF9.78143.711110.28−400.61958.010.94Grid-SVR32.84152.11105.34−836.431173.840.75Testing phaseANN-GA21.40164.31124.09−856.111274.740.79SVR-GA27.02142.07115.56−804.351138.050.82Grid-RF9.78143.71110.28−400.61958.010.76Grid-SVR32.84152.11105.34−836.431173.840.76Model VTraining phaseANN-GA−2.65212.08159.06−318.121537.580.63SVR-GA−10.60238.59132.55−583.221113.420.66Grid-RF−21.21132.5579.53−397.65662.750.9Grid-SVR−23.86185.57106.04−371.14901.340.83Testing phaseANN-GA26.51185.57132.551166.441564.090.83SVR-GA18.56159.06106.04−715.771086.910.83Grid-RF2.65132.55106.04−450.67954.360.67Grid-SVR−7.95106.0479.53−212.08715.770.75Table 2
The statistical performance metrics for the developed hybrid ML models over the 80–20% modeling data division scenario.
MERMSEMAEMPEMAPER2Model ITraining phaseANN-GA−38.54252.65154.75−363.451060.360.65SVR-GA−9.52244.25154.08−766.231293.020.69Grid-RF32.83256.13170.43−877.831365.770.65Grid-SVR−17.71243.98151.04−531.121127.400.66Testing phaseANN-GA27.193199.25154.61−394.37767.530.84SVR-GA38.94198.88157.71−585.79952.090.72Grid-RF28.12209.33168.85−577.061064.340.76Grid-SVR6.38187.98145.17−531.11779.820.89Model IITraining phaseANN-GA11.19244.34152.65−2214.681275.260.66SVR-GA16.59237.26148.64−2134.112628.700.685Grid-RF14.91251.78152.43−736.971441.170.66Grid-SVR−11.58228.31135.41−1862.162420.910.72Testing phaseANN-GA21.89154.13118.15−682.551102.560.80SVR-GA33.23134.97113.16−1104.831417.380.83Grid-RF26.17140.25109.19−578.821000.160.65Grid-SVR6.38187.98145.17−531.12779.8250.75Model IIITraining phaseANN-GA30.35247.37163.25−1009.141386.720.67SVR-GA3.59235.55147.26−761.821255.210.69Grid-RF−2.70155.9599.25−536.86855.200.86Grid-SVR−31.80268.65169.28−800.781380.500.62Testing phaseANN-GA93.78154.59124.46−1037.851178.380.45SVR-GA23.51142.13112.42−723.811071.390.80Grid-RF35.81126.91102.84−662.98966.920.81Grid-SVR18.62135.3696.18−800.781176.490.54Model IVTraining phaseANN-GA−113.06269.44171.97432.71994.680.61SVR-GA−6.04236.42149.41−800.341333.560.66Grid-RF−2.23130.2878.18−436.18686.680.90Grid-SVR−54.99303.65191.10−950.771615.860.51Testing phaseANN-GA−72.62139.88115.74423.351070.500.71SVR-GA12.64113.9692.45−420.64749.460.92Grid-RF−26.20153.04118.39−217.54862.890.81Grid-SVR33.19125.6497.16−926.321208.600.65Model VTraining phaseANN-GA−24.92230.48141.42−642.601227.550.72SVR-GA−15.24230.22143.09−631.341192.600.71Grid-RF−5.14142.6583.66−317.06592.590.89Grid-SVR−22.75176.60106.58−330.21860.400.83Testing phaseANN-GA−38.02149.35119.27−53.29793.330.64SVR-GA23.04138.42105.01−616.431093.900.74Grid-RF9.44145.2395.98−469.15896.690.44Grid-SVR17.41133.3694.31−723.811214.130.55Table 3
The statistical performance metrics for the developed hybrid ML models over the 90–10% modeling data division scenario.
MERMSEMAEMPEMAPER2Model ITraining phaseANN-GA−43.82250.85156.29−521.031181.230.64SVR-GA−8.58234.82148.27−629.261166.910.67Grid-RF14.09234.43151.84−822.161297.230.69Grid-SVR−15.84233.79146.80−656.041215.010.69Testing phaseANN-GA10.08106.2182.72−312.59684.220.88SVR-GA16.46100.5881.27−954.431332.150.92Grid-RF18.9884.57771.86−275.80622.070.79Grid-SVR16.46100.5881.27−954.431332.150.92Model IITraining phaseANN-GA−71.45244.98150.23−44.06970.630.66SVR-GA5.20229.71147.46−813.071290.190.69Grid-RF−3.26138.9184.65−404.59718.670.89Grid-SVR−7.78221.91134.74−627.861156.570.73Testing phaseANN-GA−27.24110.1579.1819.78657.830.61SVR-GA44.15106.2285.60−754.08977.850.91Grid-RF16.26116.1991.95−757.041163.950.77Grid-SVR40.5775.6264.78−710.36894.090.71Model IIITraining phaseANN-GA−28.96279.03173.82−901.581455.280.55SVR-GA7.97231.47148.60−839.831316.290.70Grid-RF−6.04143.0389.34−459.07769.440.88Grid-SVR−42.45266.44165.71−734.561350.490.59Testing phaseANN-GA29.79147.39116.93−889.741306.290.71SVR-GA48.07588.2172.67−703.78841.280.67Grid-RF−20.47100.6279.93−18.08592.860.71Grid-SVR−7.5496.3476.34−483.47931.940.75Model IVTraining phaseANN-GA−26.51238.59159.06−503.691219.460.66SVR-GA−2.65212.08132.55−715.771245.970.66Grid-RF−10.60132.5579.53−371.14689.260.89Grid-SVR−31.81238.59185.57−477.181272.480.61Testing phaseANN-GA−13.55140.20116.22−583.191233.320.86SVR-GA−14.73100.7881.585−214.02670.300.96Grid-RF16.8685.6576.07−375.48739.690.83Grid-SVR17.8682.1962.39−675.72751.890.63Model VTraining phaseANN-GA−74.23238.59159.06−291.611139.930.66SVR-GA−13.25212.08132.55−715.771245.970.70Grid-RF−10.60132.5579.53−397.65662.750.90Grid-SVR−15.91185.57106.04−556.711086.910.79Testing phaseANN-GA7.953106.0479.53−1113.421537.580.82SVR-GA10.60479.5353.02−238.59636.240.93Grid-RF−15.906106.0479.53−212.08715.770.50Grid-SVR5.30287.48106.04−291.61768.790.74


### 5.2. Models Graphical Evaluation

Two different graphical presentations are hereby presented for the evaluation of the performance of the proposed models. The actual and the forecasted values of the river flow for Tigris River are presented using scatter plots and Taylor diagram. The scatter plots for the three modeling scenarios of data division (70%–30%, 80%–20, and 90%–10%) and the four developed ML models (ANN-GA, SVR-GA, Grid-SVR, and Grid-RF) are illustrated in Figures10–12. It can be clearly observed that the 90%–10% data division scenario using the SVR-GA model attained the best match between the observed and forecasted river based on four-month antecedent values. For this particular data division and based on this lead time, the observed and the forecasted values by all the models were found to follow the similar trends. However, the matching between the observed and the forecasted values was found to be the best for SVR-GA model. To assess the efficacy of the models, it was justifiable to investigate the linear relationship between the time series of observed and the forecasted river flows for the testing period. The uniformity plot of river flow forecasted by SVR-GA attained the maximum determination coefficient (R2 = 0.96).Figure 10
The scatter plot between the observed and forecasted river flow using the developed ML models and for the modeling scenario data division (70%–30%).Figure 11
The scatter plot between the observed and forecasted river flow using the developed ML models and for the modeling scenario data division (80%–20%).Figure 12
The scatter plot between the observed and forecasted river flow using the developed ML models and for the modeling scenario data division (90%–10%).Another graphical presentation that was investigated for the applied predictive models was Taylor diagram [73] (Figures 13–15). It is a distinguished two-dimension graphical presentation that accompanied three statistical metrics including RMSE, correlation, and standard deviation. In harmony with the presented statistical results and the scatter plot presentation, using four-month lead time predictors for the one month ahead river flow, the SVR-GA model indicated the best forecasting value owing to the location of the model results on the Taylor map for the 90%–10% data division scenario.Figure 13
The Taylor diagram of the developed ML models and for the modeling scenario data division (70%–30%).Figure 14
The Taylor diagram of the developed ML models and for the modeling scenario data division (80%–20%).Figure 15
The Taylor diagram of the developed ML models and for the modeling scenario data division (90%–10%).The minimum instream environmental flow for the Tigris River was calculated on the basis of the SVR-GA model’s mean forecast flow obtained during the dry season. The minimum environmental flow was 215.46 m3 s−1 (based on 19.22 percent of the average flow 1121 m3 s−1). This flow refers to the minimum instream environmental flow required to maintain the organisms in the river [13].


## 5.1. Model Performance Evaluation Using Statistical Indices

The effectiveness of the proposed modeling techniques was examined by comparing the forecasted river flow with the observed river flow data. It should be noted that the data used in this investigation was continuous and without any missing value.The performance of the models in forecasting river flow one month ahead was forecasted and evaluated using several statistical metrics. Five statistical metrics were used to measure the performance of the predictive models in forecasting river flow during model testing, namely, Mean Error (ME), Root Mean Square Error (RMSE), Mean Absolute Error (MAE), Mean Percentage Error (MPE), Mean Absolute Percentage Error (MAPE), and Coefficient of Determination (R2) [66, 67]. These statistical metrics were widely used by researchers to evaluate the performance of predictive models in hydrological and machine learning models [68]. These measurements are considered a good indicator of the accuracy and robustness of the model:(6)ME=∑i=1Nyo−ypN,RMSE=∑i=1Nyo−yp2N,MAE=∑i=1Nyo−ypN,MPE=1N∑i=1Nyo−ypyo,MAPE=1N∑i=1Nyo−ypyo,R2=∑i=1Nyo−y¨o∑i=1Nyp−y¨p∑i=1Nyo−y¨o2∑i=1Nyp−y¨p22,where N is the length of the testing data set. yo and yp are the actual and forecasted river flow data. y¨o and y¨p are the mean values of the actual and forecasted river flow data.Tables1–3 present the statistical performance indicators (i.e., ME, RMSE, MAE, MPE, MAPE, and R2) for the five constructed input combinations, training and testing phases, and the three data division scenarios. The tables showed that all the four hybrid ML models (ANN-GA, SVR-GA, Grid-SVR, and Grid-RF) are performed in a general good performance. However, they are varied from one input combination to another. That totally depends on the historical data memory provided by the lead time “antecedent river flow values.” A notable enhancement is achieved using the hybridized SVR-GA which collaborates with the findings of several other studies established over the literature within hydrological engineering [69–72]. It is observed that the data division plays an essential role in the learning process of the developed ML models. Apparently, increasing the span of the training phase contributes to model predictability enhancement. In quantitative terms, the best results of forecasting are attained for the SVR-GA with (RMSE = 0.04, MAE = 0.03, and R2 = 0.95). The SVR-GA model indicated boosting in forecasting accuracy; although, the other ML models obtained a reasonable prediction accuracy. This observation approved the capacity of the hybrid SVR-GA model to solve the complexity of river flow located in semiarid environment. The Coefficient of Determination (R2) was achieved more than 0.90 for almost all the input combinations over the using the SVR-GA model although the performance of the SVR-GA model over the training phase was not superior (Table 3). This can explain the feasibility of the SVR-GA to be more potent.Table 1
The statistical performance metrics for the developed hybrid ML models over the 70–30% modeling data division scenario.
MERMSEMAEMPEMAPER2Model ITraining phaseANN-GA59.32256.43175.66−1261.381549.290.63SVR-GA10.34247.05154.56−862.911285.200.68Grid-RF−2.33123.2477.09−264.95527.5440.92Grid-SVR−15.35254.68159.67−576.681198.010.58Testing phaseANN-GA66.05205.10163.48−1632.741886.530.69SVR-GA7.83157.47124.27−806.191270.950.78Grid-RF−3.25138.48108.65−380.57977.750.80Grid-SVR−5.68128.3291.09−338.22751.280.91Model IITraining phaseANN-GA−33.47331.87211.77−1370.871938.010.46SVR-GA−10.54235.56142.34−664.551183.010.72Grid-RF−7.59116.7571.18205.18490.950.93Grid-SVR−5.96234.96141.50−516.181057.580.72Testing phaseANN-GA13.75194.68137.36−744.311242.380.56SVR-GA11.80133.54108.60−506.76941.080.79Grid-RF−14.79160.42119.92−335.94936.550.73Grid-SVR42.39136.07106.04−782.931098.750.77Model IIITraining phaseANN-GA−44.17245.56150.87−218.53921.870.65SVR-GA−9.11236.37143.78−815.631334.090.72Grid-RF7.27125.0383.15−454.79921.870.91Grid-SVR−33.94273.67174.09−862.271445.520.64Testing phaseANN-GA21.40164.3153124.08−856.111274.740.80SVR-GA27.02142.074115.56−804.351138.050.87Grid-RF0.97143.7111110.28−400.61958.010.82Grid-SVR32.84152.1099105.33−836.431173.840.38Model IVTraining phaseANN-GA21.40164.36124.08−856.111274.740.67SVR-GA27.02142.07115.57−804.351138.050.69Grid-RF9.78143.711110.28−400.61958.010.94Grid-SVR32.84152.11105.34−836.431173.840.75Testing phaseANN-GA21.40164.31124.09−856.111274.740.79SVR-GA27.02142.07115.56−804.351138.050.82Grid-RF9.78143.71110.28−400.61958.010.76Grid-SVR32.84152.11105.34−836.431173.840.76Model VTraining phaseANN-GA−2.65212.08159.06−318.121537.580.63SVR-GA−10.60238.59132.55−583.221113.420.66Grid-RF−21.21132.5579.53−397.65662.750.9Grid-SVR−23.86185.57106.04−371.14901.340.83Testing phaseANN-GA26.51185.57132.551166.441564.090.83SVR-GA18.56159.06106.04−715.771086.910.83Grid-RF2.65132.55106.04−450.67954.360.67Grid-SVR−7.95106.0479.53−212.08715.770.75Table 2
The statistical performance metrics for the developed hybrid ML models over the 80–20% modeling data division scenario.
MERMSEMAEMPEMAPER2Model ITraining phaseANN-GA−38.54252.65154.75−363.451060.360.65SVR-GA−9.52244.25154.08−766.231293.020.69Grid-RF32.83256.13170.43−877.831365.770.65Grid-SVR−17.71243.98151.04−531.121127.400.66Testing phaseANN-GA27.193199.25154.61−394.37767.530.84SVR-GA38.94198.88157.71−585.79952.090.72Grid-RF28.12209.33168.85−577.061064.340.76Grid-SVR6.38187.98145.17−531.11779.820.89Model IITraining phaseANN-GA11.19244.34152.65−2214.681275.260.66SVR-GA16.59237.26148.64−2134.112628.700.685Grid-RF14.91251.78152.43−736.971441.170.66Grid-SVR−11.58228.31135.41−1862.162420.910.72Testing phaseANN-GA21.89154.13118.15−682.551102.560.80SVR-GA33.23134.97113.16−1104.831417.380.83Grid-RF26.17140.25109.19−578.821000.160.65Grid-SVR6.38187.98145.17−531.12779.8250.75Model IIITraining phaseANN-GA30.35247.37163.25−1009.141386.720.67SVR-GA3.59235.55147.26−761.821255.210.69Grid-RF−2.70155.9599.25−536.86855.200.86Grid-SVR−31.80268.65169.28−800.781380.500.62Testing phaseANN-GA93.78154.59124.46−1037.851178.380.45SVR-GA23.51142.13112.42−723.811071.390.80Grid-RF35.81126.91102.84−662.98966.920.81Grid-SVR18.62135.3696.18−800.781176.490.54Model IVTraining phaseANN-GA−113.06269.44171.97432.71994.680.61SVR-GA−6.04236.42149.41−800.341333.560.66Grid-RF−2.23130.2878.18−436.18686.680.90Grid-SVR−54.99303.65191.10−950.771615.860.51Testing phaseANN-GA−72.62139.88115.74423.351070.500.71SVR-GA12.64113.9692.45−420.64749.460.92Grid-RF−26.20153.04118.39−217.54862.890.81Grid-SVR33.19125.6497.16−926.321208.600.65Model VTraining phaseANN-GA−24.92230.48141.42−642.601227.550.72SVR-GA−15.24230.22143.09−631.341192.600.71Grid-RF−5.14142.6583.66−317.06592.590.89Grid-SVR−22.75176.60106.58−330.21860.400.83Testing phaseANN-GA−38.02149.35119.27−53.29793.330.64SVR-GA23.04138.42105.01−616.431093.900.74Grid-RF9.44145.2395.98−469.15896.690.44Grid-SVR17.41133.3694.31−723.811214.130.55Table 3
The statistical performance metrics for the developed hybrid ML models over the 90–10% modeling data division scenario.
MERMSEMAEMPEMAPER2Model ITraining phaseANN-GA−43.82250.85156.29−521.031181.230.64SVR-GA−8.58234.82148.27−629.261166.910.67Grid-RF14.09234.43151.84−822.161297.230.69Grid-SVR−15.84233.79146.80−656.041215.010.69Testing phaseANN-GA10.08106.2182.72−312.59684.220.88SVR-GA16.46100.5881.27−954.431332.150.92Grid-RF18.9884.57771.86−275.80622.070.79Grid-SVR16.46100.5881.27−954.431332.150.92Model IITraining phaseANN-GA−71.45244.98150.23−44.06970.630.66SVR-GA5.20229.71147.46−813.071290.190.69Grid-RF−3.26138.9184.65−404.59718.670.89Grid-SVR−7.78221.91134.74−627.861156.570.73Testing phaseANN-GA−27.24110.1579.1819.78657.830.61SVR-GA44.15106.2285.60−754.08977.850.91Grid-RF16.26116.1991.95−757.041163.950.77Grid-SVR40.5775.6264.78−710.36894.090.71Model IIITraining phaseANN-GA−28.96279.03173.82−901.581455.280.55SVR-GA7.97231.47148.60−839.831316.290.70Grid-RF−6.04143.0389.34−459.07769.440.88Grid-SVR−42.45266.44165.71−734.561350.490.59Testing phaseANN-GA29.79147.39116.93−889.741306.290.71SVR-GA48.07588.2172.67−703.78841.280.67Grid-RF−20.47100.6279.93−18.08592.860.71Grid-SVR−7.5496.3476.34−483.47931.940.75Model IVTraining phaseANN-GA−26.51238.59159.06−503.691219.460.66SVR-GA−2.65212.08132.55−715.771245.970.66Grid-RF−10.60132.5579.53−371.14689.260.89Grid-SVR−31.81238.59185.57−477.181272.480.61Testing phaseANN-GA−13.55140.20116.22−583.191233.320.86SVR-GA−14.73100.7881.585−214.02670.300.96Grid-RF16.8685.6576.07−375.48739.690.83Grid-SVR17.8682.1962.39−675.72751.890.63Model VTraining phaseANN-GA−74.23238.59159.06−291.611139.930.66SVR-GA−13.25212.08132.55−715.771245.970.70Grid-RF−10.60132.5579.53−397.65662.750.90Grid-SVR−15.91185.57106.04−556.711086.910.79Testing phaseANN-GA7.953106.0479.53−1113.421537.580.82SVR-GA10.60479.5353.02−238.59636.240.93Grid-RF−15.906106.0479.53−212.08715.770.50Grid-SVR5.30287.48106.04−291.61768.790.74


## 5.2. Models Graphical Evaluation

Two different graphical presentations are hereby presented for the evaluation of the performance of the proposed models. The actual and the forecasted values of the river flow for Tigris River are presented using scatter plots and Taylor diagram. The scatter plots for the three modeling scenarios of data division (70%–30%, 80%–20, and 90%–10%) and the four developed ML models (ANN-GA, SVR-GA, Grid-SVR, and Grid-RF) are illustrated in Figures10–12. It can be clearly observed that the 90%–10% data division scenario using the SVR-GA model attained the best match between the observed and forecasted river based on four-month antecedent values. For this particular data division and based on this lead time, the observed and the forecasted values by all the models were found to follow the similar trends. However, the matching between the observed and the forecasted values was found to be the best for SVR-GA model. To assess the efficacy of the models, it was justifiable to investigate the linear relationship between the time series of observed and the forecasted river flows for the testing period. The uniformity plot of river flow forecasted by SVR-GA attained the maximum determination coefficient (R2 = 0.96).Figure 10
The scatter plot between the observed and forecasted river flow using the developed ML models and for the modeling scenario data division (70%–30%).Figure 11
The scatter plot between the observed and forecasted river flow using the developed ML models and for the modeling scenario data division (80%–20%).Figure 12
The scatter plot between the observed and forecasted river flow using the developed ML models and for the modeling scenario data division (90%–10%).Another graphical presentation that was investigated for the applied predictive models was Taylor diagram [73] (Figures 13–15). It is a distinguished two-dimension graphical presentation that accompanied three statistical metrics including RMSE, correlation, and standard deviation. In harmony with the presented statistical results and the scatter plot presentation, using four-month lead time predictors for the one month ahead river flow, the SVR-GA model indicated the best forecasting value owing to the location of the model results on the Taylor map for the 90%–10% data division scenario.Figure 13
The Taylor diagram of the developed ML models and for the modeling scenario data division (70%–30%).Figure 14
The Taylor diagram of the developed ML models and for the modeling scenario data division (80%–20%).Figure 15
The Taylor diagram of the developed ML models and for the modeling scenario data division (90%–10%).The minimum instream environmental flow for the Tigris River was calculated on the basis of the SVR-GA model’s mean forecast flow obtained during the dry season. The minimum environmental flow was 215.46 m3 s−1 (based on 19.22 percent of the average flow 1121 m3 s−1). This flow refers to the minimum instream environmental flow required to maintain the organisms in the river [13].


## 6. Discussion and Possible Future Research Directions

The results indicate that the proposed hybrid ML models can provide high accuracy in forecasting river flows for the studied Tigris River where the variability of river flow is less. Among all the developed four models, it was noticed that SVR-GA was superior to the other models. The model revealed the ability to solve complex process related to engineering problem. SVR-GA achieved a high Coefficient of Determination for almost all the input combinations for streamflow forecasting. It can be concluded that SVR-GA has the potential to deal with dynamics and chaotic environment with high accuracy in forecasting process.In the current study, a type of forecasting is based on univariate modeling procedure where only river flow historical data was intercepted in the model development. In such case, it is suggested to use other variables such as rainfall, humidity, temperature, or even evaporation rate to have a strong relationship with river flow. However, it is worth highlighting that the proposed models demonstrated an efficient soft computing model to capture the actual trend of the river flow time series. This is highly essential for several water and environmental engineering applications and particularly for management and monitoring of flooding and mitigations events.Based on the reported results, it was observed that using 20-year river flow data is sufficient for the development of the forecasting model. However, the length of the data span used for the modeling learning process has a considerable effect on the accuracy of model performance. Therefore, this is the essential finding of the hypotheses data division scenarios on the capacity of the machine learning models. Indeed, serious attention should be given in selecting the length of data for training the models. Selecting the length of data in an appropriate way reduces underfitting and helps the modeler to choose the best size of training data. This is due to the fact that the training stage should experience the majority of river flow patterns to allow the models in the testing session to forecast river flow with an acceptable level of accuracy. The present study indicates that 20-year river flow data is enough to provide an acceptable accuracy in forecasting river flow.Another significant aspect which can improve the predictability of the applied predictive models is the optimum selection of the lead times correlated to the targeted variable. Mutual information (MI) statistical approach potentially can be integrated as a prior stage of the forecasting model development process to abstract the highly associated information. The approach is based on the information theory and the notion of entropy [74].It is worth highlighting that there is a need to extract the highly correlated features (the correlated lead times) for the development of similar developed hybrid machine learning. Hence, the deep learning model has the advantage of deploying the hidden layers to automatically extract the features. The hydrological process is linked to typical time-sequential data [75] and therefore, the forecasting of hydrological time series is based on a fixed number of previous steps selected based on correlation. For such a case, deep learning model can be trained to learn time-varying or sequential patterns by facilitating time delay units through feedback connections for the selection of antecedent values as input. The suitability of the deep learning model for hydrological application relies on its capability of providing accurate and timely time-series prediction in the systems.


## 7. Conclusion

The motivation for the current research was to forecast monthly river flow in semiarid environment. Four hybrid ML models (i.e., ANN-GA, SVR-GA, Grid-SVR, and Grid-RF) were developed for this purpose. Three data division modeling scenarios (i.e., 70%–30%, 80%–20, and 90%–10%) were proposed and inspected for the model’s performance predictability. The architecture of the applied ML models was established based on several antecedent values of the river flow in accordance with the correlation analysis. The performance of the models was assessed using a number of numerical skill indicators and graphical presentations. In general, the results demonstrated that the SVR-GA model achieved the highest ability in forecasting monthly river flow with significant accuracy. Therefore, it is possible to improve the river flow forecasting ability using the proposed hybrid machine learning model. In addition, the results indicated that building the predictive based on 90%–10% training-testing dataset attained better prediction capability. The results indicated that using 20 years of river flow data is sufficient for the development of the forecasting model. The study concluded that the size of the training data has a significant effect on the accuracy of the predicted model. The study revealed that the data division has an important role in the learning process of the developed ML models. The results demonstrated that increasing the span of the training phase can enhance the accuracy of model performance. The current research is possible to be further extended for the forecasting enhancement of river flow by including more information on river flow patterns through the inclusion of climate parameters such as rainfall, humidity, and temperature as an input. The models in the present study were developed for the forecasting of only one-step-ahead river flow. However, multiple-month ahead forecasting models are important for water resources planning and management. Although the success of SVR-GA model in forecasting one-step-ahead river flow indicates its capability in longer time-step ahead river flow forecasting, it is still necessary to examine the ability of SVR-GA model in multiple-month ahead forecasting. The study recommended using mutual information (MI) statistical approach as a prior stage of the forecasting model development process to extract the highly associated information.



---

*Source: 8844367-2020-10-30.xml*