ABSTRACT
This research explores machine learning algorithms for reservoir inflow prediction, including long shortterm memory (LSTM), random forest (RF), and metaheuristicoptimized models. The impact of feature engineering techniques such as discrete wavelet transform (DWT) and XGBoost feature selection is investigated. LSTM shows promise, with LSTMXGBoost exhibiting strong generalization from 179.81 m^{3}/s RMSE (root mean square error) in training to 49.42 m^{3}/s in testing. The RFXGBoost and models incorporating DWT, like LSTMDWT and RFDWT, also perform well, underscoring the significance of feature engineering. Comparisons illustrate enhancements with DWT: LSTM and RF reduce training and testing RMSE substantially when using DWT. Metaheuristic models like MLPABC and LSSVRPSO benefit from DWT as well, with the LSSVRPSODWT model demonstrating excellent predictive accuracy, showing 133.97 m^{3}/s RMSE in training and 47.08 m^{3}/s RMSE in testing. This model synergistically combines LSSVR, PSO, and DWT, emerging as the top performers by effectively capturing intricate reservoir inflow patterns.
HIGHLIGHTS
Proposed models can provide accurate predictions for daily inflow, rainfall, and inflow rates in similar regions and conditions.
Flood prediction using machine learning algorithms for Três Marias Reservoir (TMR) in Brazil.
Machine learning models combined with DWT can accurately predict daily inflows to the TMR in Brazil.
INTRODUCTION
Effective water resource management is crucial for national economic development, as access to water bodies such as rivers and groundwater reserves has historically driven the progress of civilizations (Peterson & Stephenson 1991). A linchpin of such management lies in the accurate quantification of runoff, generally achieved via meticulous rainfallrunoff (RR) modeling approaches (Abda et al. 2022). Since the late 19th century, RR modeling has gained prominence, culminating in the development of a plethora of hydrological models designed to simulate this critical process (Wu & Chau 2011). These models employ mathematical equations that express runoff as a function of parameters encapsulating the characteristics of the hydrological system under study. Types of RR models include physical, conceptual, distributed, semidistributed, and empirical formulations (Biftu & Gan 2001; Vidyarthi & Jain 2022). Nevertheless, accurate modeling of the RR relationship often demands exhaustive datasets and detailed catchment information.
Initiated by Arthur Samuel's introduction of the term ‘machine learning’ in 1959 during his tenure at IBM, advancements in artificial intelligence and machine learning have elicited transformative impacts across multiple disciplines, encompassing medicine, engineering, and hydrology (Govindaraju 2000). These computational approaches have significantly augmented capabilities in areas such as streamflow prediction, water management policy formulation, groundwater modeling, water quality assessment, precipitation forecasting, and reservoir operation planning (Zhang et al. 2018; Adnan et al. 2021a, 2021b). Accelerated progress in computational intelligence has facilitated the adoption of diverse techniques, including the adaptive neurofuzzy inference system (ANFIS), Gaussian process regression (GPR), long shortterm memory (LSTM), random forest (RF), and extreme learning machine (ELM) (Adnan et al. 2020, 2021a, 2021b). These methodologies have successfully mitigated many challenges traditionally encountered by hydrological managers and researchers, including predictive analysis in environments characterized by data scarcity, short lead times, and constrained financial resources.
The employment of machine learning in modeling watershed RR relationships has gained global traction, as evidenced by an extensive body of literature (Han et al. 2021; Zarei et al. 2021; Bhusal et al. 2022; Hao & Bai 2023). For instance, Van et al. (2020) deployed deep learning techniques such as convolutional neural networks (CNNs) alongside LSTM algorithms to analyze the RR interactions in the headwaters and middle sectors of the Bassac River. Notably, CNNs surpassed LSTMs in performance, owing to their efficient dependency learning capabilities, making them particularly suitable for regression problems with limited historical datasets. In a separate study, Adnan et al. (2021b) conducted comparative analyses of machine learning methods such as ANFISFCM, ANFISPSO, MARS, and M5Tree against a conceptual eventbased model (EBA4SUB) for shortterm RR modeling in the Samoggia catchment of Italy. The utilization of ensemble averaging techniques improved the predictive accuracy of machine learning algorithms by approximately 28.8%, although EBA4SUB demonstrated superior results over MARS and M5Tree in certain instances. Furthermore, Li et al. (2021) combined the gridded surface subsurface hydrologic analysis (GSSHA) with LSTM in modeling rainfall and runoff. Utilizing hightemporal resolution data from 153 rain gauges and a decade of river discharge records, it was discerned that LSTM models offered robust and precise runoff predictions at the scale of the study area.
Wavelet theory, initially formulated by David Marr and Jean Morlet with the aim of supplanting the fast Fourier transform in image processing, required fast algorithms for its practical analysis and synthesis (Debnath 2001). Subsequent advancements in wavelet transform algorithms by Ingrid Daubechies and Stephan Mallat culminated in transformative approaches that have had farreaching implications in fields such as image compression and time series denoising. These developments have also had a substantial impact on hydrological modeling. According to a literature survey spanning the last decade, the incorporation of time–frequencybased methodologies like the discrete wavelet transform (DWT) has markedly enhanced the accuracy of machine learning algorithms and artificial intelligence systems in RR modeling and streamflow prediction (Freire et al. 2019; Nourani et al. 2019; Shoaib et al. 2019; Saraiva et al. 2021; Heddam 2022; Heddam et al. 2022; Sezen & Partal 2022; Tiwari et al. 2022). For instance, Khazaee Poul et al. (2019) integrated DWT with artificial neural networks (ANNs), ANFIS, and Knearest neighbors (KNN) to predict monthly streamflow in the St. Clair River, straddling the United States and Canada. The results indicated that the amalgamation of multiple linear regression (MLR), ANN, ANFIS, and KNN with DWT elevated the Nash–Sutcliffe coefficients from initial values of 0.340, 0.404, 0.376, and 0.419 to 0.907, 0.930, 0.923, and 0.847, respectively. In another study focusing on daily flow rate prediction in the Sebaou River basin of Northern Algeria, Abda et al. (2021a) evaluated the efficacy of a neurofuzzy paradigm in conjunction with assorted wavelet families. The results demonstrated superior performance when utilizing an ANFISbased mother wavelet db7 for daily flow rate prognostication. Ouma et al. (2021) employed LSTM and ANNDWT algorithms to model the RR dynamics of the Nzoia hydrologic basin, utilizing satellitebased meteorological data. The computational outcomes showed that both algorithms achieved the lowest root mean square error (RMSE), albeit ANNDWT required marginally more time to attain this level.
In Brazil, water resources are not uniformly distributed, so making accurate inflow forecasts to reservoirs is crucial for effective water management. This is particularly important in regions where fluctuating water availability poses challenges. In such contexts, researchers commonly use traditional statistical models based on historical data to predict reservoir inflows. However, these conventional models often fail to capture the complex nuances of hydrological systems, resulting in imprecise forecasts.
This research delves into the domain of reservoir inflow prediction, employing a comprehensive exploration of various machine learning algorithms and advanced methodologies to improve predictive accuracy. The study focuses mainly on evaluating LSTM, RF, and metaheuristicoptimized models such as MLPABC, MLPPSO, and LSSVRPSO. It also investigates the transformative impact of feature engineering techniques, including the application of DWT and the use of XGBoost for feature selection. The core objective is to elucidate the unique strengths and performance characteristics of each model, scrutinizing their efficacy in capturing intricate patterns within reservoir inflow data. The primary metric for assessing predictive accuracy is the RMSE, which provides a quantitative measure of model performance. The research not only benchmarks these algorithms against one another but also seeks to identify the added value of DWT and XGBoost in enhancing predictive capabilities.
Furthermore, the study extends its investigation into the synergy of optimization techniques, focusing on particle swarm optimization (PSO) and its integration with DWT in the LSSVRPSODWT model. This hybrid approach is explored for its potential to enhance model robustness and improve pattern recognition capabilities. The ultimate goal is to provide valuable insights into the nuanced interplay between algorithmic choices, feature engineering, and optimization strategies in the context of predicting reservoir inflow for the Três Marias Reservoir in Minas Gerais, Brazil. These insights aim to guide practitioners and researchers in selecting the most suitable models for specific conditions, thereby contributing to the advancement of predictive capabilities in water resource management.
STUDY AREA
The São Francisco River boasts an average flow rate exceeding 3,000 m^{3}/s, a figure that not only demonstrates substantial variability but also surpasses the discharge levels of prominent rivers like the Rhine at its mouth, the Nile at Khartoum, and the Tigris and Euphrates. Located near Três Marias in Minas Gerais, the Três Marias Dam, constructed in 1962, plays a critical role in flood mitigation and hydroelectric power generation. This dam stretches 2,700 m in length and stands 75 m high. At its eastern end, it houses a power station, while a spillway is positioned on its eastern side. The resulting reservoir covers an area of 1,040 km^{2} and provides a significant storage capacity of 21 km^{3} (Santos et al. 2017, 2018).
MATERIALS AND METHODS
TRMM rainfall data
In the current study, data from the tropical rainfall measuring mission (TRMM) are utilized as the primary source for satellitederived precipitation estimates to evaluate the RR relationship at the Três Marias Reservoir. Figure 1(b) shows the grid overlaying the Upper São Francisco subbasin used to gather TRMM data, along with the corresponding areas of each measurement node within the Thiessen polygon network (Do Nascimento et al. 2022). Initiated as a joint venture between the Japanese Aerospace Exploration Agency (formerly NASDA) and NASA, TRMM focuses on monitoring precipitation in tropical and subtropical zones, which encompass about twothirds of the world's precipitation. The mission aims to enhance understanding of global climate processes by providing detailed observations of rainfall patterns and latent heat fluxes across a geographic range from 35° N to 35° S. This area, largely comprising oceanic expanses, traditionally lacks extensive surface and radiosonde atmospheric data (Nicholson et al. 2003; Santos et al. 2019; Brasil Neto et al. 2022).
Streamflow data
The dataset reveals marked seasonality in inflow volumes. During the wet months of January and February, inflow volumes significantly exceed those recorded during the arid months of June and July. The median inflow rates peak at 4 cubic meters per second (m^{3}/s) in January, then decrease to just 1.5 m^{3}/s by July. Additionally, the interquartile range broadens during the wet season, reflecting more pronounced fluctuations in daily inflow volumes. In contrast, the dry season features reduced but more consistent daily inflows. Outliers exceeding 8 m^{3}/s are found exclusively in the wet months and are generally linked to episodes of extreme precipitation. In summary, the reservoir experiences sporadic, highvolume inflows during the wet season, while inflows during the dry season are lower but more stable.
Conversely, the PACF plot for daily inflows (Figure 4(b)) shows a pattern similar to that observed for rainfall, albeit with relatively lower autocorrelation coefficients. Positive autocorrelations at lags of 1, 2, and 3 days are discernible, but their magnitudes are less pronounced compared with those of rainfall. This suggests a weaker connection between inflow measurements on nonconsecutive days. Following this analysis of autocorrelations, six distinct input configurations were identified for preliminary testing using both classical and basic hybrid models. Each model progressively includes more variables to potentially enhance the prediction accuracy by incorporating additional preceding data points. These models are detailed as follows:
Input Combination Model 1: P_{t}_{+1} and Q_{t}
Input Combination Model 2: P_{t}_{+1}, P_{t}, and Q_{t}
Input Combination Model 3: P_{t}_{+1}, Q_{t}, and Q_{t}_{−1}
Input Combination Model 4: P_{t}_{+1}, P_{t}, Q_{t}, and Q_{t}_{−1}
Input Combination Model 5: P_{t}_{+1}, Q_{t}, Q_{t}_{−1}, and Q_{t−2}
Input Combination Model 6: P_{t}_{+1}, P_{t}, Q_{t}, Q_{t}_{−1}, and Q_{t}_{−2}
Input Combination Model 7: P_{t}_{+1}, Q_{t}, Q_{t}_{−1}, Q_{t}_{−2}, and Q_{t}_{−3}
Input Combination Model 8: P_{t}_{+1}, P_{t}, Q_{t}, Q_{t}_{−1}, Q_{t}_{−2}, and Q_{t}_{−3}
DWTbased multiresolution analysis
Mallat's algorithm, integral to wavelet analysis, processes a function f(t) or signal x(t) using both lowpass and highpass filters. This dual filtering results in two distinct vectors: cA1 and cD1. The vector cA1 contains approximation coefficients that capture the lowfrequency components of the signal, representing the general trend or the slowchanging aspects. On the other hand, cD1 comprises detail coefficients that isolate highfrequency components, which detail rapid changes or fine structures within the signal. The algorithm allows for iterative applications on cA1, where each iteration decomposes the approximation further, producing new vectors for more detailed levels of analysis. This process, detailed by Mallat (1991), enables multiscale resolution of the original signal.
Conversely, the DWT plot for daily inflows (Figure 5(b)) displays significant coefficient magnitudes across a range of frequencies, particularly at levels 3–5. This variation suggests that inflows are influenced by factors operating across multiple temporal scales, encompassing both longterm trends and shortterm fluctuations. The presence of highfrequency components in the inflow data likely reflects responses to transient meteorological events or sudden changes in hydrological conditions. As a result, the inflow signal exhibits a more complex structure, characterized by variability over a broader frequency bandwidth compared with the rainfall data. For modeling purposes, observed values at discrete time steps (t) are used as input vectors. These vectors include not only the current day's inflow values but also those from preceding days (t − 1, t − 2,…, t − n), providing a comprehensive dataset for analysis.
Given the complexities observed in inflow signals, selecting the appropriate input features for forecasting models is crucial. The choice of input variables significantly impacts the model's predictive accuracy and its capacity to capture the intricacies inherent in inflow dynamics. To rigorously assess their effectiveness, eight distinct models were developed, each incorporating different combinations of input features aimed at evaluating their proficiency in forecasting Q_{(t+1)}:
Input Combination Model 1: P_{D}_{1(t+1)} and Q_{D}_{1(t)}
Input Combination Model 2: P_{D}_{1(t+1)}, Q_{D}_{1(t)}, and Q_{D}_{2(t)}
Input Combination Model 3: P_{D}_{1(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, and Q_{D}_{3(t)}
Input Combination Model 4: P_{D}_{1(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}
Input Combination Model 5: P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, and Q_{D}_{1(t)}
Input Combination Model 6: P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, and Q_{D}_{2(t)}
Input Combination Model 7: P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, and Q_{D}_{3(t)}
Input Combination Model 8: P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}
Each model was developed to discern the most efficacious combination of input features that accurately forecast Q_{(t+1)}, thereby enhancing predictive reliability and model robustness in varying hydrological conditions.
Multilayer perceptron algorithm
This function ensures that the output values fall within the open interval (0, 1). For training MLPs, various optimization techniques are employed, including conjugate gradient methods, quasiNewton methods, and the Levenberg–Marquardt algorithm. In this study, the Levenberg–Marquardt algorithm is utilized due to its superior stability compared with the Gauss–Newton method and its ability to find optimal solutions even when the initial conditions are far from the minimum (Abda et al. 2021a, 2021b).
Least squares support vector regression
Least squares support vector regression (LSSVR) is a variant of support vector machines (SVMs) adapted for regression tasks. This method focuses on minimizing the sum of squared errors, subject to error tolerances controlled by specific parameters. LSSVR is particularly effective for analyzing and modeling hydrological time series data, as it adeptly captures temporal dependencies and nonlinear patterns. This capability makes it invaluable for examining longterm trends, seasonality, and the impact of climate variability on hydrological processes (Kisi 2015; Yaseen et al. 2016).
Here, λ is the regularization parameter and ε is the tolerance parameter. The optimization problem is typically solved using quadratic programming techniques. Once optimal values for and b are determined, predictions for a new input x can be made using Equation (5). The choice of the kernel function ( (e.g., linear, polynomial, or radial basis function) and the tuning parameters ε and depend on the specifics of the problem and dataset. In this case, the Gaussian (RBF) kernel was applied.
Particle swarm optimization
PSO is a technique used to find optimal solutions to problems. Imagine a scenario where a group of particles, each representing a potential solution, navigates through a search space. Each particle has a specific position (a set of values representing a potential solution) and velocity (the direction and speed of movement). PSO is commonly utilized in machine learning and optimization challenges to finetune model parameters, enhancing performance Eberhart & Kennedy (1995).
Researchers like Yarat et al. (2021) and Houssein et al. (2021) have identified PSO as a prominent metaheuristic algorithm.
How PSO works:
Initialization:
The process begins by generating a set of random particles within the search space.
Each particle is assigned a random position and velocity .
Objective function:
The effectiveness of each particle's position is assessed using an objective function f(x).
Update the particle velocity and position:
Particles update their velocity based on their best found position and the best position in the swarm.
Repeat:
Steps 2 and 3 are repeated until a satisfactory solution is achieved or a maximum number of iterations is reached.
This iterative process enables particles to learn from one another, sharing information about optimal solutions, thereby allowing the swarm to collectively navigate the search space and converge on the best solution.
In neural networks, PSO can optimize weights and biases, the parameters determining how the network processes input data. Similarly, in the LSSVR, PSO finetune coefficients and kernel parameters to minimize errors, thereby improving model fit with training data. Both scenarios leverage PSO's groupbased optimization strategy. In this research, the configuration of the PSO algorithm was established through simulation trials, with specific hyperparameters detailed in Table 1.
Optimizer or feature selection processor .  Parameter .  Value . 

PSO  Number of iterations  1,000 
Number of swarms  100  
υmax (variable lower bound)  5  
υmin (variable upper bound)  −5  
c1 (personal training coefficient)  1.5  
c2 (overall training coefficient)  2  
w (inertia weight)  1  
wdamp (inertia weight damping ratio)  0.99  
ABC  Population size  100 
ABC cycle (maximum number)  1,000  
Employed bees ne  49  
Onlooker bees ne  50  
Random scouts  1  
Stagnation limit for site abandonment stlim  10 × Dimension  
XGBoost  objective  reg:squarederror 
Maximum depth of a tree  5  
Step size shrinkage  0.1  
Number of boosting rounds  20  
Subsample ratio of the training  0.8  
Subsample ratio of columns of each tree  0.1  
Random seed for reproducibility  42 
Optimizer or feature selection processor .  Parameter .  Value . 

PSO  Number of iterations  1,000 
Number of swarms  100  
υmax (variable lower bound)  5  
υmin (variable upper bound)  −5  
c1 (personal training coefficient)  1.5  
c2 (overall training coefficient)  2  
w (inertia weight)  1  
wdamp (inertia weight damping ratio)  0.99  
ABC  Population size  100 
ABC cycle (maximum number)  1,000  
Employed bees ne  49  
Onlooker bees ne  50  
Random scouts  1  
Stagnation limit for site abandonment stlim  10 × Dimension  
XGBoost  objective  reg:squarederror 
Maximum depth of a tree  5  
Step size shrinkage  0.1  
Number of boosting rounds  20  
Subsample ratio of the training  0.8  
Subsample ratio of columns of each tree  0.1  
Random seed for reproducibility  42 
Artificial bee colony optimization
Artificial bee colony (ABC) optimization, developed by Karaboga (2010), is a metaheuristic, swarmbased algorithm primarily used to tackle global optimization problems. In the realm of deep learning, ABC is applied to optimize neural network hyperparameters, enhancing model performance significantly (Chen et al. 2023). Below is a succinct mathematical description of the ABC algorithm:
Initialization:
Begin by generating an initial population of N solutions, solutions, where each solution potentially resolves the optimization problem.
Employed bees phase:
The objective is to discover solutions that enhance the MLP model's performance, evaluated using an objective function, such as the mean squared error.
Onlooker bees phase:
Solutions are selected probabilistically, where higherperforming solutions have a greater likelihood of selection. Onlooker bees then refine these solutions similarly to the employed bees.
Scout bees phase:
If any solutions do not show improvement over a set number of iterations, they are replaced with new, randomly generated solutions. This phase allows the exploration of different areas within the search space.
The iterative execution of these phases enables the ABC algorithm to navigate the MLP model's complex parameter landscape effectively, gradually converging toward an optimal configuration of weights and biases that minimizes the objective function. In this study, after multiple simulation runs, the optimal hyperparameters for PSO and ABC applied to both MLP and LSSVR models were identified. These optimal configurations are summarized in Table 1, reflecting the results of the iterative optimization process.
Integration of LSTM and RF with XGBoost
LSTMXGBoost and RFXGBoost: This approach utilizes LSTM and RF algorithms as regressors to make predictions. Feature importance scores derived from the LSTM and RF models are used to select the most relevant features, which are then employed to train an XGBoost model, serving as the final prediction model. The integration of RF and XGBoost combines the strengths of both treebased and boosting methodologies, enhancing the ability to capture both linear and nonlinear relationships in the data (Chen et al. 2020).
In XGBoost, the calculation of feature importance scores is primarily based on the frequency and impact of each feature in the decision trees throughout the boosting rounds. Specifically, the importance of a feature is gauged by counting the number of times the feature is used to make splits in the trees. This count is then weighted by the gain from each split, which reflects the improvement in model performance attributed to that feature. The method ensures that features that frequently contribute to effective splits and yield significant performance enhancements are highlighted as most important:
is the mean squared error of the parent node before the split, and and are the mean squared errors of the left and right child nodes after the split, respectively. and are the numbers of samples in the left and right child nodes, respectively, and is the total number of samples in the parent node.
Where is the gain of the ith split that involves the feature, is the frequency of the feature in the ith split, and n is the total number of splits involving the feature.
The selection of hyperparameters for XGBoost, as detailed in Table 1, aims to optimize the balance between model complexity and performance, facilitating robust feature selection and enhancing overall accuracy. Normalization and weighting play essential roles in boosting model performance. Normalization, specifically through Min–Max scaling, ensures uniform contribution from all input features, which accelerates convergence and enhances model efficacy. Weighting, on the other hand, addresses data imbalances and emphasizes critical inflow patterns, thereby improving predictive accuracy. Each hyperparameter is strategically chosen to impact model performance significantly, ensuring that the model remains both accurate and generalizable:
1. Objective (reg:squarederror): This specifies the squared error as the loss function to minimize, which prioritizes larger errors by squaring their values. This emphasis helps focus the model on reducing significant prediction errors.
2. Maximum depth of a tree (max_depth = 5): This hyperparameter limits each decision tree's maximum depth. Setting the depth to five strikes a balance between capturing complex relationships and preventing overfitting, ensuring that the trees do not become too complex.
3. Step size shrinkage (Learning rate, eta = 0.1): The learning rate determines how much each tree contributes to the model. A lower learning rate of 0.1 ensures gradual updates, which helps prevent overfitting and allows for more nuanced adjustments to feature weights across boosting rounds.
4. Number of boosting rounds (nrounds = 20): This sets the number of trees in the model. With 20 rounds, the model can adequately refine the weighting of features through iterative adjustments, improving the model's accuracy and robustness.
5. Subsample ratio of the training set (subsample = 0.8): Specifying that 80% of the training data is used for each tree introduces variability, which reduces the risk of overfitting and prevents the model from relying too heavily on any particular part of the data.
6. Subsample ratio of columns for each tree (colsample_by_tree = 0.1): This parameter limits each tree to using only 10% of the features, promoting diversity in the features used across different trees and helping the model explore a variety of feature combinations.
7. Random seed for reproducibility (seed = 42): Setting a constant seed ensures that the randomness in the selection of data and features is consistent across different runs, facilitating reliable comparisons and evaluations of the model's performance.
These hyperparameters, including max_depth, subsample, and colsample_by_tree, introduce necessary regularization to curb overcomplexity and random variability. This careful calibration prevents the model from overfitting, ensuring stable performance and balanced feature weighting.
Performance criteria
In these equations, Q_{o,i} and Q_{s,i} represent the observed and simulated values, respectively. N denotes the sample size of the time series. and refer to the mean values of the observed and simulated data, respectively.
RESULTS
This section presents the results of the analytical investigation. In the preliminary assessments, the performance of various simple and rudimentary hybrid models was evaluated. These models include LSTM, RF, LSTMXGBoost, RFXGBoost, LSTMDWT, RFDWT, LSTMXGBoostDWT, and RFXGBoostDWT, with RMSE used as the primary metric for evaluation. Table 1 details the configurations of the PSO, ABC, and XGBoost algorithms utilized in this study.
The hybrid LSTMXGBoost model demonstrates exceptional performance during both training and testing phases, proving itself as a robust algorithm. For several input combinations, this model exhibits a significant decrease in RMSE, indicating its adeptness at capturing and generalizing patterns from training data to new, unseen data. For instance, in Input Combination 4, the model recorded a training RMSE of 183.376 m^{3}/s, which impressively reduced to 59.061 m^{3}/s during testing, highlighting its capability to discern crucial dynamics within reservoir inflow (Figure 7(a)). This trend of RMSE reduction is consistent across multiple input combinations, including 1, 2, 3, 5, 6, 7, and 8, where the LSTMXGBoost model consistently minimized RMSE during testing. Notably, Input Combination 7 (P_{t}_{+1}, Q_{t}, Q_{t}_{−1}, Q_{t}_{−2}, and Q_{t}_{−3}) stands out with the model achieving a training RMSE of 179.809 m^{3}/s and a remarkably low testing RMSE of 49.424 m^{3}/s, showcasing its exceptional generalization capabilities (Figure 7(a)).
The RFXGBoost model stands out as a formidable competitor, showcasing strong performance throughout both training and testing phases. For instance, in Input Combination 3, the model achieved a training RMSE of 73.829 m^{3}/s, which slightly improved to 73.00 m^{3}/s during testing, illustrating its consistent accuracy with unseen data (Figure 7(a)). This pattern of RMSE reduction is consistent across various input combinations, including 1, 2, 4, 5, 6, and 8, where the RFXGBoost model routinely lowers the RMSE during testing phases. Particularly impressive is Input Combination 7 (P_{t}_{+1}, Q_{t}, Q_{t}_{−1}, Q_{t}_{−2}, and Q_{t}_{−3}), where the model recorded a training RMSE of 73.446 m^{3}/s and reduced it further to 68.117 m^{3}/s during testing, highlighting its robust generalization capabilities (Figure 7(a)). These results establish the RFXGBoost hybrid model as a promising tool for reservoir inflow prediction, effectively leveraging the strengths of both RF and XGBoost to deliver accurate and reliable forecasts across a variety of scenarios.
Table 2 showcases the performance metrics during both the training and testing phases for the most effective models. During the training phase, the LSTM model achieved an NSE of 0.787, with an RMSE of 309.905, an MAE of 211.703, and an R of 0.916. The RF model stood out as the top performer, recording an NSE of 0.962, an RMSE of 131.776, an MAE of 63.459, and an R of 0.981, underscoring its superior predictive capabilities. Additionally, the hybrid models LSTMXGBoost and RFXGBoost, both utilizing Input Combination 7, demonstrated high effectiveness with NSE values of 0.928 and 0.988, respectively, further validating their robustness in handling complex data patterns (Table 2).
Phase .  Algorithm .  Best model .  NSE .  RMSE .  MAE .  R . 

Without DWT  
Training  LSTM  2  0.787  309.905  211.703  0.916 
RF  7  0.962  131.776  63.459  0.981  
LSTMXGBoost  7  0.928  179.809  92.241  0.964  
RFXGBoost  7  0.988  73.447  37.225  0.994  
Testing  LSTM  2  0.674  173.883  135.384  0.964 
RF  7  0.962  59.711  33.241  0.982  
LSTMXGBoost  7  0.974  49.424  28.948  0.988  
RFXGBoost  7  0.950  68.117  35.473  0.977  
With DWT  
Training  LSTMDWT  4  0.869  242.943  138.2  0.947 
RFDWT  4  0.977  101.408  48.979  0.989  
LSTMXGBoostDWT  8  0.970  116.899  63.502  0.985  
RFXGBoostDWT  8  0.994  54.009  26.948  0.997  
Testing  LSTMDWT  4  0.774  144.738  87.571  0.907 
RFDWT  4  0.966  56.375  30.698  0.984  
LSTMXGBoostDWT  8  0.974  49.004  23.345  0.987  
RFXGBoostDWT  8  0.969  53.825  25.967  0.984 
Phase .  Algorithm .  Best model .  NSE .  RMSE .  MAE .  R . 

Without DWT  
Training  LSTM  2  0.787  309.905  211.703  0.916 
RF  7  0.962  131.776  63.459  0.981  
LSTMXGBoost  7  0.928  179.809  92.241  0.964  
RFXGBoost  7  0.988  73.447  37.225  0.994  
Testing  LSTM  2  0.674  173.883  135.384  0.964 
RF  7  0.962  59.711  33.241  0.982  
LSTMXGBoost  7  0.974  49.424  28.948  0.988  
RFXGBoost  7  0.950  68.117  35.473  0.977  
With DWT  
Training  LSTMDWT  4  0.869  242.943  138.2  0.947 
RFDWT  4  0.977  101.408  48.979  0.989  
LSTMXGBoostDWT  8  0.970  116.899  63.502  0.985  
RFXGBoostDWT  8  0.994  54.009  26.948  0.997  
Testing  LSTMDWT  4  0.774  144.738  87.571  0.907 
RFDWT  4  0.966  56.375  30.698  0.984  
LSTMXGBoostDWT  8  0.974  49.004  23.345  0.987  
RFXGBoostDWT  8  0.969  53.825  25.967  0.984 
By extending our analysis to include the LSTMDWT, RFDWT, LSTMXGBoostDWT, and RFXGBoostDWT methods, and focusing on DWT for feature extraction from the original series, we observed notable results. The LSTMDWT model displayed varying performance across different input combinations during both the training and testing phases. For instance, Input Combination 4 (P_{D}_{1(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}) exhibited a training RMSE of 242.87 m^{3}/s, which decreased to 144.70 m^{3}/s during testing, suggesting effective generalization. Additionally, for Input Combinations 1, 2, 3, 5, 6, 7, and 8, the RMSE consistently decreased during testing, indicating that the LSTMDWT model is capable of capturing complex patterns in reservoir inflow data. For example, Input Combination 1 demonstrated a training RMSE of 547.3248 m^{3}/s, which significantly decreased to 308.2661 m^{3}/s during testing (see Figure 7(b)).
For the RFDWT model, Input Combination 4 (P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t),} and Q_{D}_{3(t)}) stands out with a training RMSE of 101.9004 m^{3}/s, which further decreases to 56.7794 m^{3}/s during testing, indicating robust generalizability. Input Combinations 1, 2, 3, 5, 6, 7, and 8 also showed decreases in RMSE during testing, underscoring the RFDWT model's effectiveness in capturing complex hydrological patterns. For example, Input Combination 1 demonstrated a training RMSE of 413.7578 m^{3}/s, which significantly decreased to 328.1562 m^{3}/s during testing (see Figure 7(b)).
Additionally, the LSTMXGBoostDWT model demonstrated distinctive performance trends across different input combinations during both the training and testing phases. Input Combination 8 (P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}) exhibited a training RMSE of 116.899 m^{3}/s, which significantly decreased to 49.004 m^{3}/s during testing, highlighting the model's effective generalization capabilities (Figure 7(b)). Similarly, Input Combinations 1, 2, 3, 4, 5, 6, and 7 also showed decreases in RMSE during testing, underscoring the effectiveness of the LSTMXGBoostDWT model. For example, Input Combination 1 demonstrated a training RMSE of 538.45 m^{3}/s, which significantly decreased to 307.428 m^{3}/s during testing (Figure 7(b)).
Furthermore, the RFXGBoostDWT model exhibited discernible performance patterns across various input combinations during both the training and testing phases. Input Combination 4 (P_{D}_{1(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}) recorded a training RMSE of 57.41 m^{3}/s, which slightly increased to 58.427 m^{3}/s during testing, indicating robust generalization. The secondbest performance was observed with Input Combination 8 (P_{D}_{1(t+1)}, P_{A}_{7(t)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, and Q_{A}_{7(t)}), with an RMSE of 54.009 m^{3}/s during training and 53.824 m^{3}/s during testing. Other input combinations, including 1, 2, 3, 5, 6, and 7, also demonstrated decreases in RMSE during testing, highlighting the effectiveness of the RFXGBoostDWT model. For example, Input Combination 1 showed a training RMSE of 222.865 m^{3}/s, which decreased to 356.28 m^{3}/s during testing (Figure 7(b)).
In the exploration of reservoir inflow prediction models leveraging DWT for feature extraction, notable performance was observed across different models. The LSTMDWT model exhibited strong performance with Input Combination 4, achieving a testing RMSE of 144.7083 m^{3}/s, indicating effective generalization. Conversely, the RFDWT model stood out with Input Combination 4, achieving the lowest testing RMSE of 56.7794 m^{3}/s, demonstrating its ability to capture complex patterns within the reservoir inflow data (Figure 7(b)). The hybrid models, LSTMXGBoostDWT and RFXGBoostDWT, introduced additional complexity by combining LSTM or RF with XGBoost and DWT. Among these, the LSTMXGBoostDWT model, particularly with Input Combination 8 (P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}), emerged as the topperforming model, achieving the lowest testing RMSE of 49.004 m^{3}/s. The RFXGBoostDWT model also performed well with Input Combination 4, achieving a testing RMSE of 53.824 m^{3}/s (Figure 7(b)).
Overall, the LSTMXGBoostDWT model, particularly with Input Combination 8 (P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}), emerges as the most promising hybrid forecasting model for reservoir inflow prediction, based on achieving the lowest RMSE. The introduction of the P_{t} input variable in Model 7 also marginally improved the RMSE.
The LSTMDWT, RFDWT, LSTMXGBoostDWT, and RFXGBoostDWT models were evaluated during both the training and testing phases. During the training phase, the RFXGBoostDWT model demonstrated exceptional performance, achieving the highest NSE of 0.994 and the lowest RMSE of 54.009 m^{3}/s, indicating its superior ability to capture patterns within the training dataset. The RFDWT model closely followed with an NSE of 0.977 and an RMSE of 101.408 m^{3}/s. All models exhibited strong linear relationships with the observed values during training. In the testing phase, the LSTMXGBoostDWT model emerged as the top performer, boasting the highest NSE of 0.974 and the lowest RMSE of 49.004 m^{3}/s, highlighting its accuracy in predicting reservoir inflow patterns. The RFDWT model also showed robust performance in the testing cohort (Table 2 and Figure 8).
Overall, in the comprehensive assessment of reservoir inflow prediction models with DWT integration, eight algorithms – LSTM, RF, LSTMXGBoost, RFXGBoost, LSTMDWT, RFDWT, LSTMXGBoostDWT, and RFXGBoostDWT – were rigorously evaluated across the training and testing phases. During the training phase, RFXGBoostDWT demonstrated remarkable performance with the highest NSE (0.994) and the lowest RMSE (54.009 m^{3}/s), indicating its superior ability to capture intricate patterns (Table 2 and Figure 8). The RFDWT model followed closely with a high NSE (0.977) and low RMSE (101.408 m^{3}/s). In the testing phase, the LSTMXGBoostDWT model stood out with the highest NSE (0.974) and the lowest RMSE (49.004 m^{3}/s), underscoring its accuracy in predicting reservoir inflow patterns. The RFDWT model also exhibited robust performance in the testing cohort (Table 2 and Figure 8).
On the other hand, the LSTM and LSTMDWT models employ distinct approaches for handling time series data. The standard LSTM model processes raw input features directly, whereas the LSTMDWT model integrates a DWT preprocessing step. This difference significantly affects the optimal set of input features for each model. For the standard LSTM model, the optimal input combination (Model 1) may reflect the inherent biases of the LSTM architecture, which excels in capturing longterm dependencies in sequential data. The preferred input features likely highlight characteristics that the LSTM mechanisms leverage effectively. Conversely, the LSTMDWT model incorporates an additional layer of feature extraction and noise reduction via DWT preprocessing, which can fundamentally change the dynamics and importance of the input features. What may have been optimal for the standard LSTM model might not suit the LSTMDWT model as well, given that the DWT step can reveal more informative patterns in the data. The observed difference in the optimal input combinations between the LSTM (Model 1) and LSTMDWT (Model 4) models suggests that the DWT preprocessing substantially impacts performance. The LSTMDWT model performs best with a different set of input features, presumably because DWT allows the model to capture underlying patterns and dynamics more effectively. This analysis underscores the importance of considering the interaction between machine learning models and preprocessing techniques applied to input data. The optimal feature set can vary considerably depending on the specific model architecture and the transformations applied, emphasizing the need for thorough feature engineering and model selection to maximize the efficacy of time series forecasting models.
The evaluation of the MLPABCDWT model for reservoir inflow prediction reveals varied performance metrics across eight distinct input combinations. While some scenarios, such as Input Combinations 1, 2, and 5, pose challenges with higher RMSE values during both training and testing, other combinations demonstrate significant success (Figure 9(b)). Notably, Input Combination 4 (P_{D}_{1(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}) achieved a remarkably low testing RMSE of 61.264 m^{3}/s, indicating the model's strong generalization capability in specific contexts. Additionally, Input Combination 8 also performed competitively with a testing RMSE of 63.322 m^{3}/s, suggesting that the model effectively captures underlying patterns in reservoir inflow data. However, the inclusion of an additional input variable, Q_{t}_{−1}, in Input Combination 5 did not result in improvements in RMSE for either the training or testing phases. This finding indicates that adding more input variables does not necessarily enhance model performance in all cases.
The evaluation of the MLPPSODWT model across eight distinct input combinations revealed diverse performance metrics for reservoir inflow prediction (Figure 9(b)). Input Combinations 1, 2, 3, 5, 6, and 7 present challenges with relatively higher RMSE values during both training and testing phases, suggesting potential difficulties in generalizing to unseen data. However, Input Combinations 4 (P_{D}_{1(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}) and 8 (P_{D}_{1(t+1)}, P_{A}_{7(t+1)}, Q_{D}_{1(t)}, Q_{D}_{2(t)}, Q_{D}_{3(t)}, and Q_{A}_{7(t)}) stand out due to their remarkably low testing RMSEs of 52.013 and 53.527 m^{3}/s, respectively. These results indicate the model's effective capacity for generalization in specific scenarios, showcasing its ability to capture underlying patterns in reservoir inflow data (Figure 9(b)).
The evaluation of the LSSVRPSODWT model across eight diverse input combinations demonstrated varying performances in reservoir inflow prediction. Input Combinations 4 and 8 had notably low testing RMSE values, indicating the model's effectiveness in generalizing to specific scenarios. These combinations highlight the LSSVRPSODWT model's ability to capture underlying patterns in reservoir inflow data. Input Combinations 5, 6, and 7 also exhibited competitive performances, underscoring the model's versatility across different input scenarios (Figure 9(b)). This nuanced analysis emphasizes the importance of understanding the model's behavior in diverse contexts and provides valuable insights for refining the LSSVRPSODWT model for robust and accurate reservoir inflow predictions. Further exploration, sensitivity analysis, and optimization strategies are recommended to determine the full potential of the model in practical applications. Special attention should be given to the outstanding performance of Input Combinations 4 and 8, which yielded the lowest testing RMSE values.
Phase .  Algorithm .  Best model .  NSE .  RMSE .  MAE .  R . 

Without DWT  
Training  MLPABC  2  0.92  190.34  99.71  0.959 
MLPPSO  1  0.92  189.77  97.6  0.959  
LSSVRPSO  2  0.921  189.36  98.31  0.96  
Testing  MLPABC  2  0.955  64.36  25.17  0.978 
MLPPSO  1  0.971  51.95  27.92  0.986  
LSSVRPSO  2  0.97  52.93  30.25  0.988  
With DWT  
Training  MLPABCDWT  4  0.959  136.788  71.006  0.979 
MLPPSODWT  4  0.957  139.883  72.070  0.978  
LSSVRPSODWT  8  0.960  133.969  67.779  0.980  
Testing  MLPABCDWT  4  0.959  61.264  26.041  0.980 
MLPPSODWT  4  0.971  52.013  28.502  0.986  
LSSVRPSODWT  8  0.976  47.077  21.699  0.988 
Phase .  Algorithm .  Best model .  NSE .  RMSE .  MAE .  R . 

Without DWT  
Training  MLPABC  2  0.92  190.34  99.71  0.959 
MLPPSO  1  0.92  189.77  97.6  0.959  
LSSVRPSO  2  0.921  189.36  98.31  0.96  
Testing  MLPABC  2  0.955  64.36  25.17  0.978 
MLPPSO  1  0.971  51.95  27.92  0.986  
LSSVRPSO  2  0.97  52.93  30.25  0.988  
With DWT  
Training  MLPABCDWT  4  0.959  136.788  71.006  0.979 
MLPPSODWT  4  0.957  139.883  72.070  0.978  
LSSVRPSODWT  8  0.960  133.969  67.779  0.980  
Testing  MLPABCDWT  4  0.959  61.264  26.041  0.980 
MLPPSODWT  4  0.971  52.013  28.502  0.986  
LSSVRPSODWT  8  0.976  47.077  21.699  0.988 
The evaluation of the best MLPABCDWT, MLPPSODWT, and LSSVRPSODWT models, as presented in Table 3, provides a comprehensive assessment of their performance in predicting reservoir inflow during both the training and testing phases. In the training phase, all three models exhibited commendable results, with high NSE values ranging from 0.957 to 0.960. Specifically, the MLPABCDWT achieved an NSE of 0.959, accompanied by an RMSE of 136.788, an MAE of 71.006, and a strong R of 0.979. The MLPPSODWT demonstrated competitive performance with an NSE of 0.957, an RMSE of 139.883, an MAE of 72.070, and an R of 0.978. The LSSVRPSODWT yielded an NSE of 0.960, an RMSE of 133.969, an MAE of 67.779, and an R of 0.980, demonstrating its effectiveness in capturing underlying patterns in the training data. During the testing phase, the MLPABCDWT maintained consistency, with an NSE of 0.959, an RMSE of 61.264, an MAE of 26.041, and an R value of 0.980. The MLPPSODWT excelled during testing, achieving an NSE of 0.971, the lowest RMSE of 52.013, an MAE of 28.502, and a strong R of 0.986. The LSSVRPSODWT continued to perform exceptionally well in the testing phase, with the highest NSE of 0.976, a low RMSE of 47.077, a minimal MAE of 21.699, and a robust R of 0.988. The comparative analysis underscores the precision of the MLPPSODWT in prediction and the reliability of the LSSVRPSODWT in minimizing absolute errors, providing valuable insights for selecting the most suitable model based on specific application requirements.
In Table 4, the evaluation of the bestperforming models and algorithms during the training phase reveals notable insights into their ability to predict reservoir inflow. The RFXGBoostDWT model emerges as the top performer, with an exceptional NSE of 0.994, signifying its ability to capture and reproduce patterns in the training data effectively. It achieves a remarkably low RMSE of 54.009, a minimal MAE of 26.948, and a nearperfect R of 0.997. Similarly, the RFXGBoost model exhibited strong performance, with an NSE of 0.988, an RMSE of 73.447, an MAE of 37.225, and an impressive R of 0.994. The LSSVRPSODWT, which represents the hybridization of LSSVR with PSO and DWT, yields substantial predictive accuracy, with an NSE of 0.960, an RMSE of 133.969, an MAE of 67.779, and a robust R of 0.980. In contrast, the conventional LSSVRPSO algorithm achieves a lower NSE of 0.921, a higher RMSE of 189.36, an increased MAE of 98.31, and an R of 0.96. This comparison highlights the superior performance of the RFXGBoostDWT model during the training phase, providing valuable insights for selecting the most effective algorithm for accurate reservoir inflow prediction.
Algorithms .  Best model .  NSE .  RMSE .  MAE .  R . 

Training phase  
RFXGBoostDWT  8  0.994  54.009  26.948  0.997 
RFXGBoost  7  0.988  73.447  37.225  0.994 
LSSVRPSODWT  3  0.960  133.969  67.779  0.980 
LSSVRPSO  2  0.921  189.36  98.31  0.96 
Testing phase  
LSSVRPSODWT  8  0.976  47.077  21.699  0.988 
LSTMXGBoostDWT  8  0.974  49.004  23.345  0.987 
LSTMXGBoost  7  0.974  49.424  28.948  0.988 
Algorithms .  Best model .  NSE .  RMSE .  MAE .  R . 

Training phase  
RFXGBoostDWT  8  0.994  54.009  26.948  0.997 
RFXGBoost  7  0.988  73.447  37.225  0.994 
LSSVRPSODWT  3  0.960  133.969  67.779  0.980 
LSSVRPSO  2  0.921  189.36  98.31  0.96 
Testing phase  
LSSVRPSODWT  8  0.976  47.077  21.699  0.988 
LSTMXGBoostDWT  8  0.974  49.004  23.345  0.987 
LSTMXGBoost  7  0.974  49.424  28.948  0.988 
In Table 4, the assessment of the best models and algorithms during the testing phase provides valuable insights into their performance for reservoir inflow prediction. The LSSVRPSODWT model emerges as the top performer, with an impressive NSE of 0.976, indicating its ability to accurately represent the observed data during testing. It achieves a low RMSE of 47.077, a minimal MAE of 21.699, and a robust R of 0.988. Similarly, the LSTMXGBoostDWT model demonstrates strong predictive accuracy, with an NSE of 0.974, an RMSE of 49.004, an MAE of 23.345, and a solid R of 0.987. The conventional LSTMXGBoost model exhibits comparable performance during testing, with an NSE of 0.974, an RMSE of 49.424, an MAE of 28.948, and a strong R of 0.988. The MLPPSO model, which represents the hybridization of the MLP algorithm with PSO, achieves competitive results with an NSE of 0.971, a low RMSE of 51.95, an MAE of 27.92, and a solid R of 0.986. The comparative analysis underscores the precision of the LSSVRPSODWT model in predicting reservoir inflow during the testing phase, offering valuable insights for selecting the most effective model for accurate and reliable predictions.
In the hybrid Model 8, the evaluation of the significance of each feature by the LSTMXGBoostDWT and RFXGBoostDWT models provided distinct insights into their respective roles in predicting the target variable (Figure 11(c) and 11(d)). Among the features considered, P_{D}_{1(t+1)} (Feature 1) and P_{A}_{7(t+1)} (Feature 2) demonstrated noteworthy importance across both models. Specifically, the LSTMXGBoostDWT model assigns normalized scores of approximately 0.1405 and 0.1390 to Feature 1 and Feature 2, respectively. Conversely, the RFXGBoostDWT model yielded lower scores of approximately 0.0446 and 0.1234 for the same features. Feature 5, representing Q_{D}_{3(t)} in the dataset, emerges as a pivotal factor in both models, with the LSTMXGBoostDWT and RFXGBoostDWT models assigning normalized scores of approximately 0.2056 and 0.1575, respectively. The significance of other features varies between the models. Notably, Feature 6 (Q_{A}_{7(t)}) garners substantial importance in the RFXGBoostDWT model, as evidenced by its normalized score of approximately 0.4045, whereas the LSTMXGBoostDWT model assigns a lower score of approximately 0.1976. These discrepancies underscore the nuanced perspectives offered by different models in evaluating feature importance, shedding light on their diverse approaches to leveraging input variables for predictive modeling.
The correlation matrix, with a focus on the target variable Q_{t}_{+1}, offers valuable insights into the relationships among different variables and the predicted variable. Notably, the detail of rainfall P_{D}_{1(t+1)} exhibited a very weak positive correlation (0.000339) with Q_{t}_{+1}, indicating a negligible linear relationship (Figure 12(b)). In contrast, the seventh approximation component P_{A}_{7(t+1)} demonstrated a moderate positive correlation (0.569641), suggesting a meaningful positive linear relationship with Q_{t}_{+1}. The first detailed component of inflow, Q_{D}_{1(t)}, displays a weak negative correlation (−0.062925), indicating a modest inverse relationship with the predicted value. Q_{D}_{2(t)} shows a weak positive correlation (0.053426), suggesting a minor positive linear relationship, while Q_{D}_{3(t)} exhibits a moderate positive correlation (0.146016), indicating a meaningful positive linear relationship (Figure 12(b)). The seventh approximation component, Q_{A}_{7(t)}, exhibited a very strong positive correlation (0.966620), emphasizing its robust linear relationship and high predictability for Q_{t}_{+1}. These insights provide valuable guidance for feature selection and engineering strategies in predictive modeling, highlighting the varying impacts of each variable on the target variable Q_{t}_{+1} (Figure 12(b)).
Table 5 presents a comprehensive statistical comparison of the observed and predicted values based on the bestproposed algorithms during the testing phase. The mean observed inflow is 269.11 m^{3}/s, ranging from a minimum of 0.00 m^{3}/s to a maximum of 3,134.00 m^{3}/s, with a standard deviation (STD) of 304.63 m^{3}/s. The observed values exhibit variability, as indicated by the standard deviation and variance (92,800). The LSSVRPSODWT model provides predictions with a mean value of 274.98 m^{3}/s, closely aligning with the observed mean. The model successfully captures the variability, with predictions ranging from 3.53 to 2,845.97 m^{3}/s. The standard deviation (302.20) and variance (91,326) suggest a good representation of the observed data, with a CV of 1.10. Similarly, the LSTMXGBoostDWT model yields a mean prediction rate of 269.66 m^{3}/s, with a broader range from −242.85 to 3,022.74 m^{3}/s. The model demonstrated variability similar to that of the observed values, with a standard deviation of 306.23 and a CV of 1.14. The LSTMXGBoost model yields a mean prediction of 279.98 m^{3}/s, which is a slight overestimation compared with the observed mean. The predictions ranged from 25.25 to 3,042.81 m^{3}/s, with a standard deviation of 293.20 and a CV of 1.05. The MLPPSO model provides predictions with a mean value of 279.63 m^{3}/s, displaying variability similar to that of the observed data. The predictions range from 0.06 to 2,987.04 m^{3}/s, with a standard deviation of 304.94 and a CV of 1.09.
Metric .  Mean .  Min .  Max .  STD .  Variance .  CV . 

Observed  269.11  0.00  3,134.00  304.63  92,800  1.13 
LSSVRPSODWT  274.98  3.53  2,845.97  302.20  91,326  1.10 
LSTMXGBoostDWT  269.66  −242.85  3,022.74  306.23  93,779  1.14 
LSTMXGBoost  279.98  25.25  3,042.81  293.20  85,963  1.05 
MLPPSO  279.63  0.06  2,987.04  304.94  92,991  1.09 
Metric .  Mean .  Min .  Max .  STD .  Variance .  CV . 

Observed  269.11  0.00  3,134.00  304.63  92,800  1.13 
LSSVRPSODWT  274.98  3.53  2,845.97  302.20  91,326  1.10 
LSTMXGBoostDWT  269.66  −242.85  3,022.74  306.23  93,779  1.14 
LSTMXGBoost  279.98  25.25  3,042.81  293.20  85,963  1.05 
MLPPSO  279.63  0.06  2,987.04  304.94  92,991  1.09 
The statistical comparison highlights the ability of the proposed algorithms to capture the variability in observed reservoir inflow during the testing phase. The LSSVRPSODWT model is a particularly robust performer that closely aligns with the observed mean and exhibits a low CV.
Table 6 compares the performance of various machine learning models used in a case study. It highlights the key advantages, disadvantages, and the training and testing NSE scores for each model. The models include standalone techniques like LSTM, RF, MLP, and LSSVR, as well as hybrid approaches that combine these with additional components like DWT, XGBoost, and optimization algorithms such as ABC and PSO.
Model .  Advantages .  Disadvantages .  Performance in the case study . 

LSTM 



LSTMDWT 



RF 



RFDWT 



LSTMXGBoost 



RFXGBoost 



LSTMXGBoostDWT 



RFXGBoostDWT 



MLPABC 



MLPPSO 



LSSVRPSO 



MLPABCDWT 



MLPPSODWT 



LSSVRPSODWT 



Model .  Advantages .  Disadvantages .  Performance in the case study . 

LSTM 



LSTMDWT 



RF 



RFDWT 



LSTMXGBoost 



RFXGBoost 



LSTMXGBoostDWT 



RFXGBoostDWT 



MLPABC 



MLPPSO 



LSSVRPSO 



MLPABCDWT 



MLPPSODWT 



LSSVRPSODWT 



DISCUSSION
Our analysis unveiled the distinct performance characteristics of various algorithms during both the training and testing phases. The LSTM algorithm demonstrated promising predictive accuracy, with training RMSEs ranging from 309.83 to 672.80 m^{3}/s and testing RMSEs ranging from 173.90 to 452.69 m^{3}/s across different input combinations. The LSTMXGBoost hybrid exhibited remarkable generalizability, achieving a training RMSE of 179.81 m^{3}/s, which notably decreased to 49.42 m^{3}/s during testing. Regarding the RFXGBoost combination, the training RMSE of 73.45 m^{3}/s slightly decreased to 68.12 m^{3}/s during testing, indicating a reasonable degree of generalizability.
The integrated DWT enhances model performance, as evidenced by the LSTMDWT and RFDWT models, which achieved testing RMSE values of 144.71 and 56.78 m^{3}/s, respectively. The LSTMXGBoostDWT and RFXGBoostDWT models also demonstrated effective generalizability, particularly for Input Combination 8, where the training RMSE of 116.90 m^{3}/s significantly decreased to 49.00 m^{3}/s during testing. Among the metaheuristicoptimized models, MLPABC, MLPPSO, and LSSVRPSO, the LSSVRPSO model consistently yielded training RMSEs ranging from 189.362 to 190.33 m^{3}/s and testing RMSEs ranging from 51.941 to 64.359 m^{3}/s across different input combinations. Introducing the DWT further refined performance, especially for the LSSVRPSODWT model, which achieved the lowest testing RMSE of 47.08 m^{3}/s. Each algorithm exhibits distinct strengths, and the introduction of the P_{t} input variable in Model 7 marginally improved the RMSE.
When comparing the best input combination of the best model based on the DWT with the same input without the DWT, the DWT shows substantial enhancements across diverse algorithms and input combinations for reservoir inflow prediction. In the case of LSTM, the introduction of DWT results in a remarkable improvement, reducing the training RMSE from 681.72 to 242.88 m^{3}/s and the testing RMSE from 434.71 to 144.71 m^{3}/s. Similarly, the RF algorithm benefits from the DWT, leading to a decrease in the training RMSE from 131.99 to 101.90 m^{3}/s and in the testing RMSE from 62.49 to 56.78 m^{3}/s. The hybrid RFXGBoost model exhibits enhanced generalization with DWT, achieving a training RMSE of 75.26 m^{3}/s and a testing RMSE of 76.96 m^{3}/s. The LSTMXGBoostDWT model achieves superior results, with a training RMSE of 116.90 m^{3}/s, which significantly decreases to 49.00 m^{3}/s during testing. The metaheuristicoptimized models also benefit, as seen in the MLPABCDWT model, where the training RMSE decreases from 190.34 to 136.79 m^{3}/s, and the testing RMSE decreases from 64.36 to 61.26 m^{3}/s. The LSSVRPSODWT combination substantially improves upon the other combinations, reducing the training RMSE from 181.06 to 133.97 m^{3}/s and the testing RMSE from 56.00 to 47.08 m^{3}/s. Overall, DWT has emerged as a powerful technique for consistently enhancing the predictive accuracy and generalization capabilities of the examined reservoir inflow prediction models.
The integration of XGBoost as a feature selection method within the LSTMXGBoost model demonstrated notable improvements, particularly for Input Combination 7. The LSTMXGBoost model without feature selection exhibited a training RMSE of 672.03 m^{3}/s and a testing RMSE of 486.39 m^{3}/s. Upon introducing XGBoost for feature selection, the training RMSE substantially decreased to 179.81 m^{3}/s, demonstrating the ability of XGBoost to enhance the model's understanding of complex relationships within the data. The testing RMSE further decreased to 49.42 m^{3}/s, indicating improved generalizability and highlighting the efficacy of XGBoost in identifying relevant features for accurate reservoir inflow prediction.
The results highlight the substantial impact of PSO on enhancing the performance of machine learning models. For instance, MLPPSO demonstrated significant improvements, with a training RMSE of 189.72 m^{3}/s and a testing RMSE of 51.94 m^{3}/s. Similarly, the LSSVRPSO algorithm yielded favorable results, achieving a training RMSE of 189.36 m^{3}/s and a testing RMSE of 52.93 m^{3}/s. These outcomes emphasize the ability of PSO to finetune model parameters, contributing to improved predictive accuracy during both the training and testing phases. Furthermore, the comparison with MLPABC, which has a training RMSE of 190.34 m^{3}/s and a testing RMSE of 64.36 m^{3}/s, underscores the effectiveness of PSO in achieving superior results. Additionally, the LSSVRPSODWT variant, which incorporates DWT, shows even greater improvements. With training RMSEs ranging from 133.97 to 135.13 m^{3}/s and testing RMSEs ranging from 47.08 to 50.56 m^{3}/s, the combination of PSO and DWT has synergistic effects, further enhancing the ability of the model to capture intricate patterns in reservoir inflow data. These findings underscore the value of PSO as a powerful optimization technique for refining reservoir inflow prediction models. Initial comparative analysis involving classical machine learning algorithms such as MLP and LSSVR, optimized using PSO and ABC, revealed a notable performance edge for PSOoptimized algorithms. Specifically, MLPPSO and LSSVRPSO outperformed the other combinations across various skill metrics in both the training and testing datasets. This observation aligns with existing scholarly works; for instance, Tikhamarine et al. (2020) noted a marked uptick in hydrological studies employing metaheuristic optimization techniques, with PSO emerging as the most prevalently utilized method. The effectiveness of MLPPSO in hydrological modeling has been validated by multiple studies (Tran et al. 2017; Tikhamarine et al. 2020; Aoulmi et al. 2021; Abda et al. 2021a, 2021b; JahandidehTehrani et al. 2021). As indicated by Roy & Singh (2020), hybrid metaheuristic algorithms such as Grey Wolf Optimizer (GWO) and PSO demonstrate superior daily streamflow prediction capabilities.
Based on the successful results obtained from DWT input combinations, the inclusion of the approximation component (A) along with the first three details (D1, D2, and D3) obtained through DWT in machine learning algorithms represents a comprehensive approach for capturing both highfrequency variations and the overall trend within a time series. While the details focus on preserving and leveraging highfrequency components that contribute to rapid changes and transient patterns, the approximation component encapsulates the lowerfrequency, smoother aspects of the signal, capturing the longterm trends and underlying patterns (Das et al. 2021; Shahfahad et al. 2023). By integrating both highfrequency details and the trend component, machine learning models can construct a holistic representation of time series dynamics. The approximation component (A7) serves as a valuable addition, carrying essential information about the overall trend and structural characteristics of the signal. This additional context enhances the ability of machine learning algorithms to discern broader patterns and variations in the data, leading to more robust and accurate predictions (Zerouali et al. 2022, 2023). The synergy between detailed analysis and approximate components offers a balanced perspective that addresses both finegrained variations and overarching trends within the time series (Abebe et al. 2022a, 2022b; Li et al. 2023; Sharma et al. 2023). This comprehensive feature set improves the adaptability of the models, enabling them to navigate various scales of information present in the signal, thus providing a more nuanced understanding of the underlying dynamics for improved predictive performance. The necessity of using time–frequency methods such as DWT and empirical mode decomposition (EMD) for noise mitigation (Ouma et al. 2021; Abebe et al. 2022a, 2022b; Wei & You 2022; Alqahtani et al. 2023) has led to the incorporation of DWT preprocessing into these models, which contributed to a 17–29% reduction in the LSTM and RF test RMSEs. This reinforces the DWT's capability to enhance model generalizability, a finding consistent with the extant literature, such as the work by Ahmadi et al. (2022), which documented enhanced RF performance via DWT and EMD preprocessing.
In comparison with other models presented in Table 7, the ‘LSSVRPSODWT’ model from this study, based at the Três Marias Reservoir, Brazil, demonstrated the strongest performance. It achieved the highest NSE score of 0.976, surpassing other models like the MGBIPH model (Schwanenberg et al. 2015) with an NSE of 0.977 and the ANNDWT model (Santos et al. 2019) with an NSE of 0.968. Furthermore, the LSSVRPSODWT model recorded an RMSE of 47.07, significantly lower than most models, such as the MLPDWT model (Santos et al. 2014) with an RMSE of 200.04, and the ANNDWT model (Freire & Santos 2020) with RMSEs ranging from 94.32 to 728.45. The only model with a lower RMSE is the LSTM model (Tang et al. 2021) at the Shouxi River, China, with an RMSE of 4.49, but this model was applied in a different study area. The LSSVRPSODWT model's superior performance, trained on a large daily dataset from 1998 to 2019, underscores the importance of comprehensive data in achieving high NSE and RMSE scores.
Models .  Reference .  Data type .  Location .  RMSE .  NSE .  Data amount . 

LSTM  Yeditha et al. (2022)  CHIRPS  Mahanadi River Basin (India)  208.27  0.88  2000–2018 (daily) 
TankLSSVR  Kwon et al. (2020)  soil moisture (SM) data  The Yongdam Catchment (Republic of. Korea)  12.91  0.85  2007 and 2016 (daily) 
MLPDWT  Santos et al. (2014)  Inflow  Três Marias Reservoir (Brazil)  200.04  –  1931–2011 (daily) 
MGBIPH model (Muskingum)  Schwanenberg et al. (2015)  Ensemble forecast data  Três Marias Reservoir (Brazil)  72.37  0.977  2011–2012 
ANNDWT  Freire & Santos (2020)  Inflow  Sobradinho Reservoir Julho Reservoir Itaipu Reservoir (Brazil)  94.3232 347.3893 728.4548  0.8575 −0.1352 0.7690  1931–2010 (daily) 
ANNDWT  Santos et al. (2019)  TRMM  Três Marias Reservoir (Brazil)  –  0.968  1998–2012 (daily) 
LSTM  Tang et al. (2021)  IMERG data  The Shouxi River (China)  4.49  0.92  2014–2020 (hourly) 
ANN  Rachidi et al. (2023)  Terra climate data  Essaouira Coastal Basin (Morocco)  15.32  0.81  1984–2021 (monthly) 
self organizing map (SOM)  Do Nascimento et al. (2022)  TRMM  Três Marias Reservoir (Brazil)  –  0.82  1998–2019 (monthly) 
MLPPSOEMD  Gomaa et al. (2023)  TRMM data  Três Marias Reservoir (Brazil)  60.03  0.96  1998–2019 (daily) 
LSSVRPSODWT  This study  TRMM data  Três Marias Reservoir (Brazil)  47.07  0.976  1998–2019 (daily) 
Models .  Reference .  Data type .  Location .  RMSE .  NSE .  Data amount . 

LSTM  Yeditha et al. (2022)  CHIRPS  Mahanadi River Basin (India)  208.27  0.88  2000–2018 (daily) 
TankLSSVR  Kwon et al. (2020)  soil moisture (SM) data  The Yongdam Catchment (Republic of. Korea)  12.91  0.85  2007 and 2016 (daily) 
MLPDWT  Santos et al. (2014)  Inflow  Três Marias Reservoir (Brazil)  200.04  –  1931–2011 (daily) 
MGBIPH model (Muskingum)  Schwanenberg et al. (2015)  Ensemble forecast data  Três Marias Reservoir (Brazil)  72.37  0.977  2011–2012 
ANNDWT  Freire & Santos (2020)  Inflow  Sobradinho Reservoir Julho Reservoir Itaipu Reservoir (Brazil)  94.3232 347.3893 728.4548  0.8575 −0.1352 0.7690  1931–2010 (daily) 
ANNDWT  Santos et al. (2019)  TRMM  Três Marias Reservoir (Brazil)  –  0.968  1998–2012 (daily) 
LSTM  Tang et al. (2021)  IMERG data  The Shouxi River (China)  4.49  0.92  2014–2020 (hourly) 
ANN  Rachidi et al. (2023)  Terra climate data  Essaouira Coastal Basin (Morocco)  15.32  0.81  1984–2021 (monthly) 
self organizing map (SOM)  Do Nascimento et al. (2022)  TRMM  Três Marias Reservoir (Brazil)  –  0.82  1998–2019 (monthly) 
MLPPSOEMD  Gomaa et al. (2023)  TRMM data  Três Marias Reservoir (Brazil)  60.03  0.96  1998–2019 (daily) 
LSSVRPSODWT  This study  TRMM data  Três Marias Reservoir (Brazil)  47.07  0.976  1998–2019 (daily) 
However, these hybrid models face several limitations and challenges. Their high complexity increases the risk of overfitting (Xu et al. 2023), necessitating careful model selection and validation to balance performance with generalization (D'hooge et al. 2023). Large, highquality datasets are essential for effective learning, and employing these models with limited or lowerquality data can lead to subpar performance, often requiring strategies such as data augmentation (Li et al. 2024a). The complex nature of these hybrid architectures also makes them difficult to interpret, limiting their use in applications that demand model transparency (Taye 2023). Computational demands may restrict realtime or resourceconstrained deployments, and the sensitivity of these models to data distributions and shifts can degrade performance over time, necessitating domain adaptation techniques (Wang et al. 2024). Additionally, these models may not inherently capture domainspecific knowledge or physical constraints, making the incorporation of expert knowledge beneficial (Li et al. 2024b). Thorough validation across diverse scenarios is crucial to assess the models' limitations and ensure their robustness and reliability in realworld applications.
Further synergistic integration of the DWT with XGBoost and PSO improved model efficacy. All the algorithm hybrid models demonstrated minimal testing RMSEs, underscoring the benefits of hybrid frameworks. The use of DWT for decomposing inflow signals into essential low and highfrequency components, coupled with XGBoost for feature selection and PSO for the efficient optimization of machine learning parameters, significantly enhanced the generalizability and accuracy of the models.
CONCLUSIONS
This research paper explores the application of various machine learning algorithms, including LSTM, RF, LSTMXGBoost, RFXGBoost, MLPABC, MLPPSO, and LSSVRPSO, as well as their hybrid variants with DWT and XGBoost feature selection, for reservoir inflow prediction. The comprehensive analysis of different input combinations and algorithmic configurations provides valuable insights into their performance during both the training and testing phases. Notably, the results indicate that LSTM, particularly when combined with XGBoost, demonstrates promising predictive accuracy and generalizability. The integration of DWT enhances the performance of certain algorithms, such as LSTMDWT and RFDWT. Additionally, the application of metaheuristic optimization techniques, particularly PSO, has contributed to significant improvements in models such as MLPPSO and LSSVRPSO.
This research highlights the importance of algorithm selection, feature engineering, and optimization strategies in achieving accurate and reliable reservoir inflow predictions. The comparative analysis sheds light on the strengths and weaknesses of each model, providing valuable guidance for researchers and practitioners in the field. Future work may involve further exploration of hyperparameter tuning, additional feature engineering techniques, and the evaluation of alternative optimization algorithms to continue advancing the accuracy and robustness of reservoir inflow prediction models. Overall, this study contributes to the growing body of knowledge in hydroinformatics and reinforces the significance of leveraging advanced machine learning techniques for water resource management.
ACKNOWLEDGEMENTS
The authors extend their appreciation to Taif University, Saudi Arabia, for supporting this work through the project number (TUDSPP202414). Additional thanks are extended to the National Electrical System Operator (ONS) for providing the observed daily streamflow data and the Tropical Rainfall Measuring Mission (TRMM) for supplying the necessary rainfall data. Contributions from these organizations were instrumental to the successful completion of this study.
AUTHOR CONTRIBUTIONS
E.A.: Conceptualization, Methodology, Software, Validation, Formal analysis, Writing – original draft, Visualization; B.Z.: Conceptualization, Methodology, Software, Validation, Formal analysis, Writing – original draft, Visualization; N.B.: Conceptualization, Methodology, Software, Validation, Writing – review and editing, Visualization; O.M.K.: Conceptualization, Methodology, Software, Validation, Formal analysis, Writing – original draft, Writing – review and editing, Visualization; C.A.G.S.: Conceptualization, Formal analysis, Visualization, Writing – original draft, Writing – review and editing; S.S.M.G.: Software, Formal analysis, Writing – review and editing, Validation; A.R.M.T.I.: Methodology, Software, Validation, Formal analysis, Writing – original draft. All authors have read and agreed to the published version of the manuscript.
FUNDING
This research was funded by Taif University, Taif, Saudi Arabia (TUDSPP202414).
DATA AVAILABILITY STATEMENT
Data cannot be made publicly available; readers should contact the corresponding author for details.
CONFLICT OF INTEREST
The authors declare there is no conflict.