# Three Steps towards Better Forecasting for Streamflow Deep Learning
## 3 Results and Discussion  
This section unveils the results acquired from the training and testing of various LSTM models. There are three steps involved (refer to Figure 6). For Step 1, numerous LSTM and ANN models are employed to perform streamflow prediction. The performance is evaluated for the goodness of fit by executing several measures listed in Section 2.6. Table 1 \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Best ANN Model** & & & & & \\ \hline
**\# of Neurons in Layer 1** & **R.Train** & **R.Test** & **MSE** & **MAE** & **NSE** & **RMSE** \\ \hline \(10\) & 0.4520 & 0.4254 & 78.4215 & 3.7135 & 0.1994 & 8.8556 \\ \hline
**Best LSTM Model** & & & & & & \\ \hline
**Model** & **R.Train** & **R.Test** & **MSE.Train** & **MSE.Test** & **MAE.Train** & **MAE.Test** & **NSE** & **RMSE** \\ \hline Simul. & 0.9055 & 0.8586 & 17.8532 & 28.8315 & 1.4365 & 2.4208 & 0.8190 & 5.3695 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Best LSTM and ANN models for prediction. Figure 8: Graph of LSTM observed flow vs. simulated flow. Figure 7: Graph of ANN model observed flow vs. simulated flow. Step 2 introduces rates of change and executes multi-step ahead forecasting to facilitate the flood mitigation operation better. LSTM models are performed on multiple conditions, mainly simulation, 30 min ahead forecasting, 1 h ahead forecasting and rates of change \(\delta Q\). Table 2 lists the performance of this exercise. Step 3 develops several new hybrids of artificial intelligence. Three metaheuristic frameworks are selected for execution with the deep learning LSTM models: the bat algorithm, firefly algorithm and Jaya algorithm. Table 3 shows the streamflow prediction performance models for the hybrid model of the bat algorithm and LSTM. The parameters set for these models consist of maximum iteration = 40, alpha = 0.95, gamma = 0.95, bat numbers = 4, bat minimum frequency = 0, bat maximum frequency = 1 and maximum epochs = 500. Table 4 displays the performance of the LSTM model after integration with the firefly algorithm. The parameters set for these models consist of maximum iteration = 40, alpha = 0.95, betta = 1, gamma = 0.95, firefly numbers = 4 and maximum epochs = 500. Table 5 shows the performance of the LSTM model with the Jaya algorithm. The parameters set for these models consist of maximum iteration = 30, population = 5 and maximum epochs = 500. Figure 9 displays graphs of observed vs. forecast flow based on simulation, 30 min ahead forecasting, 1 h ahead forecasting and rates of change model. \begin{table}
\begin{tabular}{c c c c c c c c} \hline
**Model** & **R.Train** & **R.Test** & **MSE.Train** & **MSE.Test** & **MAE.Train** & **MAE.Test** & **NSE** & **RMSE** \\ \hline
0 min. & 0.9491 & 0.8214 & 9.6326 & 43.8420 & 1.3235 & 2.5607 & 0.9006 & 3.1036 \\
**30 min.** & 0.9743 & 0.9291 & 5.0785 & 12.5037 & **0.5178** & 0.7324 & 0.9493 & 2.2536 \\ \(1\) h & 0.9146 & 0.8447 & 15.8306 & 30.6191 & 0.8815 & 1.2835 & 0.8365 & 3.9788 \\ \(\delta Q\) & 0.9733 & 0.8990 & 5.1913 & 20.4748 & 0.4910 & 0.8525 & 0.9465 & 2.2784 \\ \hline \end{tabular}
\end{table} 
Table 4: Performance of LSTM with firefly algorithm models for streamflow. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline
**Model** & **R.Train** & **R.Test** & **MSE.Train** & **MSE.Test** & **MAE.Train** & **MAE.Test** & **NSE** & **RMSE** \\ \hline
0 min. & 0.9055 & 0.8586 & 17.8532 & 28.8315 & 1.4365 & 2.4208 & 0.8190 & 5.3695 \\
30 min. & 0.9470 & 0.9476 & 10.2326 & 10.0042 & 0.5640 & 0.6935 & 0.8963 & 3.1629 \\
1 h & 0.8849 & 0.8677 & 21.4296 & 25.0978 & 0.9397 & 1.2829 & 0.7828 & 5.0098 \\ \(\delta Q\) & 0.9545 & 0.9214 & 8.9746 & 15.6981 & 0.5434 & 0.8108 & 0.9090 & 2.9958 \\ \hline \end{tabular}
\end{table} 
Table 2: LSTM forecasting models.