Short-term streamflow modeling using data-intelligence evolutionary machine learning models

Accurate streamflow prediction is essential for efficient water resources management. Machine learning (ML) models are the tools to meet this need. This paper presents a comparative research study focusing on hybridizing ML models with bioinspired optimization algorithms (BOA) for short-term multistep streamflow forecasting. Specifically, we focus on applying XGB, MARS, ELM, EN, and SVR models and various BOA, including PSO, GA, and DE, for selecting model parameters. The performances of the resulting hybrid models are compared using performance statistics, graphical analysis, and hypothesis testing. The results show that the hybridization of BOA with ML models demonstrates significant potential as a data-driven approach for short-term multistep streamflow forecasting. The PSO algorithm proved superior to the DE and GA algorithms in determining the optimal hyperparameters of ML models for each step of the considered time horizon. When applied with all BOA, the XGB model outperformed the others (SVR, MARS, ELM, and EN), best predicting the different steps ahead. XGB integrated with PSO emerged as the superior model, according to the considered performance measures and the results of the statistical tests. The proposed XGB hybrid model is a superior alternative to the current daily flow forecast, crucial for water resources planning and management.

www.nature.com/scientificreports/days ahead, using antecedent values as inputs, and observed that the proposed model outperformed the standard in all forecast horizons.
Hybrid machine learning models were tested for flood prediction by 19 .In their study, the authors applied GWO-optimized MLP and SVR models (MLP-GWO and SVR-GWO) and observed that SVR-GWO achieved superior results compared to MLP-GWO.The results also demonstrate that using GWO as an optimizer results in a potential improvement in the performance of MLP and SVM models for flood forecasting.
Other recent hybrid approaches aimed at enhancing the performance of machine learning (ML) models for streamflow forecasting also deserve special mention.These include the linear and stratified selection in deep learning algorithms by 48 ; forest-based algorithms applied to neural network models as investigated by 49 ; the use of meta-heuristic algorithms (MHA) in artificial neural networks (ANN) as explored by 50 ; PSO integration for parameter selection in ANN 51 ; and novel hybrid approaches based on conceptual and data-driven techniques 52 .Table 1 presents the summary of some hybrid models resulting from the optimization of the parameters.
As noted earlier, many studies compare hybrid models with their corresponding standard models or compare the same ML model using different algorithms to select their parameters, often applied for one-step-ahead streamflow forecasting.In this work, various ML models are combined with different optimization algorithms for parameter selection, allowing us to identify not only the best ML model and the optimal parameter optimization algorithm but also the best hybrid model among those developed.It's also important to highlight its application to multi-step-ahead forecasting, an area that is still relatively unexplored in the literature.From another perspective, there are very few studies on the combination of ML and hydrology in Africa, particularly in Mozambique.This work aims to address this gap, which represents a novel contribution to the field.
This study compares the performance of machine learning models combined with the genetic algorithm (GA), differential evolution (DE), and particle swarm optimization (PSO) algorithms for modeling and forecasting the flow of the Zambezi River, which is a tributary to the Cahora-Bassa hydroelectric dam in Mozambique.The forecasts are conducted within a short-term time horizon, specifically considering forecast horizons of 1, 3, 5, and 7 days ahead (a multistep-ahead forecasting strategy).
The paper is organized as follows: "Materials and methods" covers the study area, data, machine learning models, bioinspired optimization algorithms applied, and the proposed methodology."Result and discussion" presents the results of the computational experiments, along with comparative analysis and discussion.Finally, "Conclusion" provides the conclusion.

Materials and methods
This section outlines the materials and methods employed in this study.It encompasses the study area and data, the machine learning (ML) models, and bioinspired algorithms utilized, and concludes with an overview of the proposed methodology.
Study area and data.The research area is situated in a sub-basin of the Zambezi River, specifically, the Medium Zambezi terminal, located upstream of the Cahora Bassa dam in Tete province, Mozambique. Figure 1 depicts the automatic monitoring stations used in this study.
The Cahora-Bassa dam plays a critical role in Mozambique as it supplies the majority of the country's electricity and that of neighboring regions.Additionally, it supports downstream economic activities in the Zambezi Table 1.Summary of hybrid artificial intelligence methods by parameter optimization for flow forecasting.It's worth noting that the data analyzed in this study has been used in previous research conducted by the same authors 26,[54][55][56][57] .

Machine learning models.
9][60][61] is an ensemble method that combines weak predictors to generate a strong predictor.XGB prediction for an i instance is where G = g(x) = w q(x) (q : R m → T, w ∈ R T ).

Support vector regression (SVR)
. SVR 17,[62][63][64] is a classic regression method that estimation function is: www.nature.com/scientificreports/where ψ(x) is a kernel function in a feature space, w is the weight vector, b is a bias, and N is the number of samples.
Elastic net (EN).EN [65][66][67][68] is the generalized linear model expressed as: where α ≥ 0 , w 2 and w 2 are respectively the norm L 1 and the norm L 2 of the parameter array, and ρ is the the parameter's rate L 1 .

Multivariate adaptive regression spline (MARS).
MARS [69][70][71] is the method consist of sequential piecewise linear regression splines of the form: where c 0 is a constant quantity, B K m (x) the m-th basis function, and c m is the unknown coefficient.
Extreme learning machine.ELM [72][73][74] is an artificial neural network described by Eq. (3), i.e there are β i , w i and b i such that: where w i is the i-th neuron in the hidden layer, β i is the connection weight of the ith neuron of the hidden layer and the neuron of the output layer, b i is the bias of the ith neuron of the hidden layer, and g(•) denotes an activa- tion function.

Bioinspired optimization algorithms.
Reservoir operation optimization is a complex nonlinear problem, involving a large number of decision variables and multiple constraints.In the field of water resources, various metaheuristic algorithms have been employed to address this issue.These methods often involve modifying existing algorithms or creating hybrid algorithms, ultimately contributing to the reduction of water deficits in (1) min  54 .

Genetic algorithm (GA).
GA is a subclass of evolutionary algorithms used for the objective of optimization via natural genetics and selection 76 .The genetic operations are crossover, reproduction, and mutation 77 .
In the GA, a set of potential solutions to a problem are generated randomly.Each solution is evaluated using the adequacy function, which is intended to be optimized.New solutions is generated probabilistically from the best ones of the previous step, and some of these are inserted directly into the new population, while others are used as a basis to generate new individuals, using genetic operators 76,78 .
Diferential evolution (DE).DE 32,79,80 is a nature-inspired algorithm that adapts the individuals through mutation genetic operators, recombination, and selection 81 .DE consists of the following 82 steps: 1. Initialization of parameters 2. Population initialization.Particle swarm optimization (PSO).PSO 83 is an algorithm based on the natural movements of biological swarms (flocks of birds) considering their position and speed 41 .
The PSO formula for the initial iteration is: where P i and V i are, respectively, the particle's position and speed, P g best position in the swarm and P b best personal value Proposed methodology.A set of real data comprising four time series was used in the analysis: the river's flow into the reservoir for electricity generation (Q), precipitation (R), evaporation (E), and humidity (H).The affluent flow serves as the output variable, while the rest are employed as input or predictor variables.The task of forecasting several steps ahead in the inflow was initially approached by constructing a framework that includes input variables and their corresponding lags or delays, to accommodate the proposed machine learning models.
The determination of the number of lags/antecedents or delays for making predictions of the river's affluent flow Q t+j in the time horizon ( j = 1, 3, 5, 7 ) was accomplished using partial autocorrelation functions (PACF), autocorrelation functions (ACF), and cross-correlation function (CCF).These methods serve as a straightforward means to suggest the number of antecedents, aiding in identifying the factors influencing the output variable.
Autoregression analysis using ACF/PACF and CCF for the analyzed variables is depicted in Figs. 3 and 4, respectively.Figure 3 suggests that early lags may be predictive, while Fig. 4 indicates that none or all lags could potentially be used as a CCF selection criterion.Furthermore, in Fig. 4, a cyclical pattern (seasonality) is noticeable, identified by the decline of correlation in certain time intervals (days).
In this study, seven lags, corresponding to twenty-eight (28) input variables (4 original variables × 7 lags), i.e., a 5844 × 28 matrix, were considered as input data for machine learning models using ACF/PACF as the selection criterion, since CCF was uninformative, given that the majority of lags fall within the dashed-line confidence interval, as shown in Fig. 4.
The non-significant autocorrelation observed between the response variable and the predictor variables in Fig. 4 may be attributed to the use of ACF/PACF or CCF, which are linear models.As a result, they may not detect hidden non-linear relationships or the frequent spatial variation in hydrological variables, as data from only one region were considered.Additionally, these models do not incorporate equations or physical relationships between flow and other variables.The presence of noise and hydrometeorological differences between training and test periods, known as non-stationarity, can also weaken this relationship 84,85 .
(4) The machine learning models used in this study were elastic net (EN), extreme learning machine (ELM), extreme gradient boosting (XGB), support vector regression (SVR), and multivariate adaptive regression spline (MARS).The primary objective was to evaluate their predictive capabilities for flow across different time horizons.
These models had their parameters intelligently determined using bioinspired algorithms: differential evolution (DE), genetic algorithms (GA), and particle swarm optimization (PSO).The optimization problem's objective function was the minimization of root mean square error (RMSE) calculated on the training set through a 5-fold walk-forward approach 86 .The experiments were conducted a total of 30 times, employing different random seeds.Table 2 illustrates the encoding of candidate solutions for each machine learning model to be used in each bioinspired algorithm.
The bioinspired algorithms, in turn, had their parameters detailed according to Table 3 (representing the classic versions of optimization algorithms).Each algorithm employed a population size of 16, consisting of randomly distributed individuals, with uniform distribution applied within the search space.Each individual is represented as a vector, comprising the hyperparameters specific to the machine learning model under analysis, and the length  www.nature.com/scientificreports/ of this vector is determined by the number of hyperparameters relevant to each particular machine learning model.Figure 5 illustrates the flow diagram summarizing all the steps involved in the development of this work.
To assess the performance of these models, eight different performance measures, which are commonly employed in hydrology to gauge the agreement between simulated and observed data 89,90 , were calculated to determine their robustness in terms of error and precision (refer to Table 4).Furthermore, statistical hypothesis tests, specifically ANOVA and Tukey tests 91 , were employed to evaluate the efficiency of the models.The distribution of performance measures, each based on 30 independent runs, was compared using the one-way ANOVA test.Subsequently, Tukey's test was used for multiple comparisons of the performance means of the estimators (models) to identify the superior estimator among those analyzed in terms of performance, as well as for multiple comparisons of the performance means of the metaheuristics.

Result and discussion
The flow predictions for the Cahora-Bassa reservoir were conducted with forecast horizons of 1, 3, 5, 7 days ahead, utilizing the following machine learning models: elastic net (EN), extreme learning machine (ELM), support vector regression (SVR), multivariate adaptive regression spline (MARS), and extreme gradient boosting (XGB).The parameters of these models were estimated through the use of differential evolution (DE), genetic algorithms (GA), and particle swarm optimization (PSO).This led to the development of a total of sixty (60) models, derived from the combinations of the five ML models, three metaheuristics, and four forecast horizons.
A successful execution is defined as one where the solution is both known and identified using a predetermined stopping criterion based on a maximum allowable number of evaluations.The best results among these models are denoted by being highlighted in bold.The results, in general, indicate that the models achieved good performance.However, the SVR model outperformed the others in all performance measures, except for MAE and KGE, where the XGB model exhibited better results for the forecast horizon t + 1 .Conversely, for the remaining horizons ( t + 3 , t + 5 , and t + 7 ), XGB demonstrated superior results in almost all measures, except for MAE for t + 3 and t + 5 , where the MARS model presented the lowest mean absolute error.It is noteworthy that while XGB did not always outperform the others, it consistently presented results very close to the best, ensuring its superiority and competitiveness in relation to the other models.It's evident that these distributions exhibit positive or negative asymmetries with some influence of outliers, and MARS was the model most affected by these outliers.Furthermore, in this figure, a pattern of declining performance of the models can be observed as the time horizon increases.

Performance analysis of models optimized by DE.
Figure 7 illustrates the graphs of the best solutions for each model according to RMSE; it is generally observed that the models achieved RMSE values very close to zero, ranging between 0.071 and 0.171.Specifically, XGB had the lowest RMSE of 0.071 m 3 /s for t + 3 , followed by SVR with 0.073 m 3 /s for t + 1 , MARS with 0.077 for forecast t + 3 , and finally, ELM and EN both with 0.098 m 3 /s for forecast t + 1 .Other measures of agreement between observed and predicted data, such as KGE and WI, can also be observed.The SVR model obtained values of 0.966 and 0.990 for KGE and WI, XGB achieved 0.977 and 0.991, MARS scored 0.963 and 0.989, EN obtained 0.957 and 0.982, and ELM achieved 0.955 and 0.982, respectively.Furthermore, a good approximation   92 .RMSE, MAPE, and MAE are the root mean squared error, mean absolute percentage error, and mean absolute errors, respectively.KGE is Kling-Gupta efficiency 93 .NSE (Nash-Sutcliffe efficiency) 94 .O i and P i is the real and simulated values, respectively.O is the mean of real streamflows.r are the Pearson's coefficient and α is the proportion between simulated and real values standard deviations, and β is the proportion between the averages of the simulated and observed values.

Metric acronym Expression
Vol:.( 1234567890) Performance analysis of models optimized by GA.Table 6 presents the descriptive statistics, average performance, and standard deviation measures produced by the forecast models whose parameters were optimized by GA.
The results indicate competitive performance among the models across all horizons: t + 1 , t + 3 , t + 5 , and t + 7 .The extreme gradient boosting (XGB) hybrid model outperforms other models for all measures and horizons, except for t + 3 and t + 5 , where MARS resulted in the lowest MAE, and for t + 7 , where the SVR and EN models obtained the lowest MAE and MAPE, respectively.It is also worth noting that the MARS and SVR models achieved good results compared to ELM and EN.
Figure 8 displays the distributions of the performance measures for each model across different time horizons.This figure reveals a decline in the models' performance as the forecast horizon increases.Qualitatively, the XGB model consistently exhibits superior performance compared to the other models.Additionally, greater asymmetries are observed in the distributions of performance measures, with the presence of outliers.SVR and MARS had distributions more susceptible to extreme observations, leading to higher variability in their results.
Figure 9 illustrates the graphs of the best solutions for each model according to the RMSE metric.Overall, the models achieved low RMSE values.However, XGB achieved the lowest RMSE of 0.071 m 3 /s for t + 3 , followed by SVR with 0.073 m 3 /s for t + 1 , MARS with 0.077 for forecast t + 3 , and both ELM and EN with 0.098 m 3 /s for forecast t + 1 .Other goodness-of-fit measures can also be observed, such as KGE and WI, where the XGB model achieved values of 0.978 and 0.991, MARS scored 0.963 and 0.989, SVR obtained 0.973 and 0.990, EN achieved 0.958 and 0.982, and ELM attained 0.955 and 0.982, respectively.Furthermore, when comparing the observed data with data predicted by the models, it can be observed that they closely align with the ideal line, indicating a good approximation between the observed and predicted data.Specifically, the XGB model with a forecast horizon of t + 3 exhibited the best approximation.
Performance analysis of models optimized by PSO.Table 7 presents the descriptive statistics, average performance, and standard deviation measures produced by the forecasting models with their parameters optimized by PSO.
The results demonstrated good performance of the models in all time horizons under analysis.The extreme gradient boosting (XGB) hybrid model outperformed the others in all performance measures for the horizon t + 1 .For the remaining t + 3 , t + 5 , and t + 7 , the XGB model also outperformed the other models in almost all measures, except for t + 3 and t + 5 , where MARS presented lower MAPE and MAE results, and for t + 7 , where EN had the lowest MAPE.
Figure 10 displays the distributions of each performance measure for each model across different time horizons.The figure shows a relative balance in the performance measures of the models as the forecast horizon increases, with a downward trend.Asymmetries can also be observed in the distributions of performance www.nature.com/scientificreports/measures, along with the presence of outliers.SVR exhibited the most extreme observations in its distributions, followed by MARS. Figure 11 presents the graphs of the best solutions for each model according to the RMSE metric.It is evident that the models obtained small RMSE values ranging from 0.071 to 0.171, and the XGB model achieved the smallest RMSE of 0.071 m 3 /s.Notably, the other models also achieved relatively low RMSE values: MARS with 0.077 m 3 /s for both t + 3 , SVR with 0.089 for forecast t + 1 , and ELM and EN both with 0.098 m 3 /s for forecast t + 1 .Other goodness-of-fit measures can also be observed, such as KGE and WI, with the XGB model obtaining www.nature.com/scientificreports/values of 0.977 and 0.991, MARS scoring 0.963 and 0.989, SVR achieving 0.964 and 0.986, EN reaching 0.957 and 0.982, and ELM attaining 0.956 and 0.982, respectively.Therefore, it can be observed that the horizons t + 1 and t + 3 have better fit qualities than t + 5 and t + 7. Furthermore, it can be noted in this figure that there is a good approximation between observed values and those predicted by the models.When comparing the observed data and the data predicted by the models to the ideal line, it is evident that they align closely along the same line.The XGB model with forecast horizon t + 3 demonstrated the highest level of adherence.www.nature.com/scientificreports/Comparative analysis of the results and discussion.An analysis of the results obtained with different metaheuristics used in this work allowed us to quantitatively verify that, in general, all the models performed well across all the statistics used to evaluate their performance, even in relatively distant forecasting horizons.Therefore, the integration of evolutionary and/or bioinspired algorithms in the optimization of machine learning model parameters led to these positive results in multistep forecasting of daily flow.
Evolutionary/bioinspired algorithms have demonstrated their ability to find good approximations to complex problems and have achieved favorable results in determining high-quality solutions for these problems 95 , thus enabling the attainment of state-of-the-art results 59 .
Table 8 presents the results of the one-way ANOVA statistical test.The null hypothesis of the ANOVA test posits that the average on every measurement criterion is the same for all metaheuristics or estimators.As is evident, the null hypothesis is rejected for all metrics, as the p-values for each of them are less than the 0.05 significance level.This implies that all metrics are useful criteria for assessing different metaheuristics or prediction models.
Table 9, on the other hand, presents the results of the Tukey test, which involves multiple comparisons of pairs of means from the metaheuristics.In the first column of this table, you will find the pairs of metaheuristics, followed by the mean difference in the second column, the corresponding p value in the third column, and the minimum and maximum limits of the confidence intervals associated with the differences in means for each metaheuristic pair, in the fourth and fifth columns, respectively.Lastly, the decision taken based on these comparisons is provided.The null hypothesis posits that the means of each pair of metaheuristics are equal.As observed, the null hypothesis is not rejected since all p values are greater than the significance level of 0.05.However, it's worth noting that, despite the differences not being statistically significant, PSO exhibits relatively higher values compared to DE and GA, respectively, based on the magnitude of the p values.
PSO is a modern algorithm that has been successfully applied in engineering, demonstrating high performance compared to other metaheuristics 83,96 .It has been proven to be superior in several studies focusing on flow forecasting, with notable emphasis on the following references 26,30,35,43,44,97 , among others.
It's important to highlight that DE and GA exhibited strongly non-significant differences.This observation aligns with the findings of Nguyen et al. 98 , who compared the performances of the extreme gradient boosting model relative to two evolutionary algorithms: genetic algorithms and differential evolution, i.e., GA-XGB and DE-XGB.Their study revealed that these models also displayed similar results.
The comparison between the machine learning models analyzed in this work is presented in Table 10, showing the results of the Tukey test ( α = 0.05 ) for multiple comparisons of means between pairs of models.The null hypothesis assumes that the means of each pair of models are equal.The results of this test reveal the rejection of the null hypothesis, as evident from the p values of some pairs being lower than the significance level of 0.05.This indicates that the averages of certain models differ from the averages of the other models.Specifically, the extreme gradient boosting (XGB) model outperformed the other models across all metaheuristics and forecast horizons, while the elastic net model exhibited lower results.
Table 11 illustrates all the hybrid models generated by the combination of metaheuristics and analyzed models.A total of fifteen hybrid models are obtained and compared to determine the superior model.www.nature.com/scientificreports/By combining the results analyzed separately in Tables 9 and 10, which present the Tukey tests for comparisons between metaheuristics and between models, respectively, it is evident that the extreme gradient boosting model assisted by particle swarm optimization (PSO-XGB) stands out as the superior model among all the developed models in terms of performance.
The XGB model has already demonstrated its superiority in comparison to other models when tackling machine learning challenges on various platforms such as KDD Cup and Kaggle.It has also been employed in cutting-edge applications in the industry 59 and has been utilized for classification and regression tasks, yielding www.nature.com/scientificreports/validated results in various scenarios, including customer behavior prediction, sales forecasting, hazard prediction, ad click prediction, malware rating, and web text prediction 61 .
In the context of hydrology, this model has proven to be superior to random forest (RF) 98,99 , support vector machine (SVM) 100,101 , classification and regression trees (CART) 98 , artificial neural networks 102 , and recurrent neural networks 103 in both simple and multistep flow prediction problems.Its exceptional performance has led to its application as an alternative for flood forecasting 104 .It is interesting to note that SVR and MARS achieved competitive average results considering the evaluated metrics.However, the presence of outliers for both models had a negative impact on their performance.Despite SVR and MARS having modeling features that did not match the performance of XGB, the evolutionary search played a crucial role in finding the appropriate internal parameters that led to effective flow modeling.
The models also exhibited good qualitative adherence or approximation between the observed and estimated data, indicating that the models were capable of reproducing the characteristics of the observed data series, such as level shifts during critical periods of lower and higher flows, trends, seasonality, and other hidden characteristics with excellent quality.Therefore, these models can provide valuable support for decision-making in reservoir operations planning.
However, this performance deteriorates as the forecast horizon increases, meaning that results from shorter horizons are superior to those from relatively more distant ones.The forecast horizon introduces greater complexity to the input-output relationship involving environmental variables and flow.Additionally, longer forecast horizons amplify the uncertainty in predicting the flow's future value.In this scenario, making accurate predictions with machine learning models becomes increasingly challenging due to the rising nonlinearity and uncertainty reflected in performance metrics.
Another observed factor that adversely affects the models' performance is the presence of outliers, which characterize the chaotic behavior and high stochasticity of the flow 105 .As a result, there is variability in the modeled time series data, with the variation being particularly pronounced during peak flows.Model estimation of extreme events or extreme flows is challenging.However, the significance of accurately identifying extreme flows in decision-making related to dam operations is emphasized, as incorrect forecasts of these events can lead to severe consequences in water resource management.
Many models developed in the literature primarily focus on one-step or simple forecasting.Nevertheless, the results demonstrate that for one-step-ahead forecasts, it is challenging to unequivocally favor one model over the others, as the models have achieved satisfactory results.In the case of the multi-step-ahead forecasting task, the influence of the stochastic components of time series becomes more prominent with increasing forecasting time, making it difficult to identify the number of significant lags of the variable(s) that impact the prediction process 106 .

Conclusion
In the context of sustainable and optimized water resource management and planning, the accurate prediction of flows is essential.Precise flow prediction remains a scientific challenge and has garnered significant attention due to the non-linear, non-stationary, and stochastic nature of these series.
The future of hydrological research is likely to involve maximizing information and extracting complex observations and data collected across all environmental systems to enhance the predictability of complex www.nature.com/scientificreports/environmental variables.Often, predicting these variables requires extensive datasets and substantial computational resources.This study aims to overcome these challenges by developing and evaluating five machine learning models: elastic net (EN), extreme learning machine (ELM), support vector regression (SVR), multivariate adaptive regression spline (MARS), and extreme gradient boosting (XGB).Additionally, three nature-inspired evolutionary algorithms-genetic algorithms (GA), differential evolution (DE), and particle swarm optimization (PSO)-are Differential evolution integrated into multivariate adaptive regression spline (MARS-DE) Brazil Echo state network and multi-objective optimization design (ESN-MOB) Malaysia Firefly optimization algorithm and adaptive neuro-fuzzy inference systems (ANFIS-FFA) Pakistan Particle swarm optimization algorithm and neuro-fuzzy inference systems (ANFIS-PSO) Egypt support vector regression with grey wolf optimization (GWO-SVR) Algeria Wavelet support vector regression with grey wolf optimization (GWO-WSVR) India Harris Hawks optimization and support vector regression (SVR-HHO) China Extreme learning machine with flower pollination algorithm (ELM-FPA) Pakistan Particle swarm optimization and gray wolf optimization with extreme learning machine (ELM-PSOGWO) Iran Support vector regression optimized by grasshopper optimization algorithm (GOA) with LASSO input selection Iraq Extreme learning machine model with salp swarm algorithm (SSA-ELM) Turkey Gated recurrent unit with grey wolf algorithm (GWO-GRU) Malaysia Particle swarm optimization and support vector machine (PSO-SVM) Tukey Hybrid particle swarm optimization and gravitational search algorithms with feed-forward neural network (FFN-PSOGSA) Iran Adaptive neuro-fuzzy inference systems with grey wolf optimization algorithm (GWO-ANFIS) Pakistan ANFIS with gradient-based optimization (GBO) (GBO-ANFIS) Iran ANFIS with GWO Vol:.(1234567890)Scientific Reports | (2023) 13:13824 | https://doi.org/10.1038/s41598-023-41113-5www.nature.com/scientificreports/River delta, such as farming, pastoralist work, fishing, and the construction of access roads.The dam also contributes to mitigating natural disasters like droughts and floods.Daily flow forecasts are indispensable for the operation of hydroelectric plants, including tasks such as optimizing the dam's storage capacity, operational procedures, energy generation management, maintenance of ecological flows in the reservoir, and obtaining continuous flow records in non-calibrated catchments where direct measurements are unavailable.The historical data analyzed in this research was provided by the Department of Water Resources and Environment of Hidroeléctrica de Cahora-Bassa (HCB), the largest electricity producer in Mozambique and the entity managing the Cahora-Bassa dam.The dataset comprises daily time series for variables, including affluent flows (Q), precipitation (R), evaporation (E), and relative humidity (H).The dataset consists of 5844 observations, spanning from 2003 to 2018, divided into two subsets: the training and testing sets.It's important to emphasize the seasonal characteristics of these variables.Figure 2 illustrates the training set in blue, ranging from 01/01/2003 to 06/30/2012, and the test set in orange, covering the period from 07/01/2012 to 12/31/2018.

Figure 1 .
Figure 1.Location of the study area.The EMAs points indicate the automatic monitoring stations where the data under analysis in this work are collected 54 .

Figure 3 .
Figure 3. Autocorrelation and partial autocorrelation functions.Lags within the shaded part are considered statistically non-significant 54 .

Figure 4 .
Figure 4. Cross correlation functions between flow and precipitation, evaporation or relative humidity.The lags between the dashed lines are considered statistically non-significant 54 .

AlgorithmFigure 6
Figure 6 displays violin plots representing the distributions of performance measures across different time horizons.It's evident that these distributions exhibit positive or negative asymmetries with some influence of outliers, and MARS was the model most affected by these outliers.Furthermore, in this figure, a pattern of declining performance of the models can be observed as the time horizon increases.Figure7illustrates the graphs of the best solutions for each model according to RMSE; it is generally observed that the models achieved RMSE values very close to zero, ranging between 0.071 and 0.171.Specifically, XGB had the lowest RMSE of 0.071 m 3 /s for t + 3 , followed by SVR with 0.073 m 3 /s for t + 1 , MARS with 0.077 for forecast t + 3 , and finally, ELM and EN both with 0.098 m 3 /s for forecast t + 1 .Other measures of agreement between observed and predicted data, such as KGE and WI, can also be observed.The SVR model obtained values of 0.966 and 0.990 for KGE and WI, XGB achieved 0.977 and 0.991, MARS scored 0.963 and 0.989, EN obtained 0.957 and 0.982, and ELM achieved 0.955 and 0.982, respectively.Furthermore, a good approximation

Figure 5 .
Figure 5. Flowchart summarizes the proposed methodology of the work.

Figure 6 .
Figure 6.Violin to DE charts showing the distributions of the 30 runs of each metric for each model across the different forecast horizons.

Figure 7 .
Figure 7. Best solution according to RMSE for flows of 1, 3, 5, 7 days ahead to DE showing levels of agreement between observed and predicted data.

Figure 8 .
Figure 8. Violin plots for GA showing the distributions over 30 runs of the analyzed models on performance metrics across forecast horizons.

Figure 9 .
Figure 9. Best solution for each model according to RMSE for flows of 1, 3, 5, 7 days ahead with GA showing levels of agreement between observed and predicted data.

Figure 10 .
Figure 10.Violin plots for PSO showing the distributions over 30 runs of the analyzed models on performance metrics across forecast horizons.
Table 5 presents a quantitative study of the models' performance, displaying averages and corresponding standard deviations of the performance measures for models optimized by DE across different time horizons.

Table 2 .
Candidate solutions' coding.The IP column denotes the internal parameter used in the bioinspired algorithms' encoding.

Table 3 .
Description of the specific parameters of the optimization algorithms.

Table 4 .
Performance metrics used in the test set.WI is the Willmott indices

Table 5 .
Descriptive statistics (means and standard deviations) of the performance measures of models optimized with DE in the test set.

Table 6 .
Descriptive statistics (means and standard deviations) of the performance measures of models optimized with GA in the test set.

Table 7 .
Descriptive statistics (means and standard deviations) of the performance measures of models optimized with PSO in the test set.