# Time Series Forecasting of Thermal Systems Dispatch in Legal Amazon Using Machine Learning
## 4 Results and Discussion
### Comparative Analysis  
In this subsection, a comparative analysis with variations of the LSTM and ANFIS models is presented. Specifically, for the LSTM, the RMSprop, Adam, and SGDM optimizers are evaluated, and the evaluated parameter is the number of hidden units, with 10, 50, 100, and 500 hidden units. For the ANFIS, the FCM, grid partition, and subtractive clustering are considered; for the FCM, the parameter evaluated is the number of clusters. Table 5 shows the results of this comparison in relation to the bagged ensemble learning model.  
The ANFIS model using the grid partition only converged using two membership functions (MFs) for the input variables; when using more MFs, the model did not converge. When subtractive clustering is evaluated, no combination of parameters results in the convergence of the model. For this reason, the grid partition and subtractive clustering are not presented in Table 5. This issue also occurred when using CNN-LSTM; models based on deep learning did not result in acceptable prediction values.  
For the LSTM, the best results were achieved using 500 hidden units in both RMSprop and SGDM. An attempt was made to use more hidden units but the model did not converge  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline  & & **Stacking** & **Boosting** & **Bagging** \\ \hline \multirow{4}{*}{MSE} & Max & \(1.48\times 10^{5}\) & \(1.40\times 10^{5}\) & \(6.44\times 10^{3}\) \\  & Min & \(1.48\times 10^{5}\) & \(3.80\times 10^{4}\) & \(6.29\times 10^{3}\) \\  & Mean & \(1.48\times 10^{5}\) & \(8.57\times 10^{4}\) & \(6.38\times 10^{3}\) \\  & Std Deviation & \(8.82\times 10^{-11}\) & \(2.63\times 10^{4}\) & \(3.35\times 10^{1}\) \\  & Variance & \(7.78\times 10^{-21}\) & \(6.90\times 10^{8}\) & \(1.12\times 10^{3}\) \\ \hline \multirow{4}{*}{MAE} & Max & \(1.76\times 10^{2}\) & \(2.14\times 10^{2}\) & 4.57 \\  & Min & \(1.76\times 10^{2}\) & \(7.90\times 10^{1}\) & 3.7 \\  & Mean & \(1.76\times 10^{2}\) & \(1.62\times 10^{2}\) & 4.04 \\  & Std Deviation & \(1.15\times 10^{-13}\) & \(3.25\times 10^{1}\) & \(1.83\times 10^{-1}\) \\  & Variance & \(1.32\times 10^{-26}\) & \(1.06\times 10^{3}\) & \(3.34\times 10^{-2}\) \\ \hline \multirow{4}{*}{MAPE} & Max & \(7.02\) & \(1.19\times 10^{1}\) & \(1.22\times 10^{-1}\) \\  & Min & \(7.02\) & 3.65 & \(7.25\times 10^{-2}\) \\  & Mean & \(7.02\) & 8.44 & \(8.90\times 10^{-2}\) \\  & Std Deviation & \(3.59\times 10^{-15}\) & 2.05 & \(1.18\times 10^{-2}\) \\  & Variance & \(1.29\times 10^{-29}\) & 4.19 & \(1.39\times 10^{-4}\) \\ \hline \multirow{4}{*}{R\({}^{2}\)} & Max & \(4.22\times 10^{-1}\) & \(8.52\times 10^{-1}\) & \(9.75\times 10^{-1}\) \\  & Min & \(4.22\times 10^{-1}\) & \(4.56\times 10^{-1}\) & \(9.75\times 10^{-1}\) \\ \cline{1-1}  & Mean & \(4.22\times 10^{-1}\) & \(6.66\times 10^{-1}\) & \(9.75\times 10^{-1}\) \\ \cline{1-1}  & Std Deviation & - & \(1.02\times 10^{-1}\) & \(1.31\times 10^{-4}\) \\ \cline{1-1}  & Variance & - & \(1.05\times 10^{-2}\) & \(1.71\times 10^{-8}\) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Statistical analysis of ensemble learning approaches.  
when a greater number of hidden units was used. For the Adam optimizer, the best result was using 100 hidden units. Among the optimizers used for the LSTM, the best result was using Adam; however, this result was inferior in all the metrics evaluated compared to the bagged ensemble model, proving, in this comparative analysis, that the approach used in this article is the most suitable to be applied to this challenge.