## 4 Model Testing and Results Analysis
### Results Analysis and Comparison
Indeed, deep models' structure enables transforming data multiple times to get the final output, allowing to learn deeper information. On the other hand, shallow methods generally can transform the data only one or two times to reach the output, limiting their ability to learn complicated patterns from input data. \begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Model** & **Dataset** & **RMSE** & **MAE** & \(\mathbf{R^{2}}\) & **EV** \\ \hline VAE & 1 & 8.053 & 6.063 & 0.851 & 0.904 \\  & 2 & 3.633 & 2.094 & 0.947 & 0.949 \\  & 3 & 1.619 & 1.139 & 0.965 & 0.967 \\  & 4 & 6.691 & 4.922 & 0.847 & 0.902 \\  & 5 & 3.707 & 2.691 & 0.931 & 0.948 \\  & 6 & 3.257 & 2.464 & 0.971 & 0.972 \\ \hline GAHD-VAE & 1 & 3.336 & 2.81 & 0.975 & 0.979 \\  & 2 & 2.393 & 1.616 & 0.977 & 0.98 \\  & 3 & 1.586 & 0.97 & 0.968 & 0.968 \\  & 4 & 4.053 & 3.077 & 0.945 & 0.954 \\  & 5 & 3.641 & 2.853 & 0.933 & 0.952 \\  & 6 & 2.824 & 1.867 & 0.978 & 0.978 \\ \hline SVR & 1 & 17.334 & 16.595 & 0.314 & 0.927 \\  & 2 & 10.384 & 9.11 & 0.575 & 0.815 \\  & 3 & 2.892 & 2.199 & 0.893 & 0.914 \\  & 4 & 11.484 & 10.739 & 0.559 & 0.877 \\  & 5 & 8.605 & 8.002 & 0.627 & 0.816 \\  & 6 & 3.227 & 2.753 & 0.416 & 0.618 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Performance comparison of the proposed GAHD-VAE, traditional VAE, SVR, LR, RR, and Lasso. In the next numerical experiments, we compared the performance of the proposed GAHD-VAE approach to that of GRU, LSTM, BiLSTM, BiGRU, CNN, and ConvLSTM models because of their popularity in modeling and forecasting time-series data. Figure 5a-f displays the measured and the forecasted traffic flow obtained by the proposed GAHD-VAE and the six considered deep learning models when applied to the six traffic datasets. From Figure 5a-f, we observe that the forecasted traffic flows from the seven models closely followed the measured traffic flow data (solid line) for all test datasets. Figure 6a-f present the boxplots of forecasting errors, which is the deviation between the forecasted and the measured traffic flow values. The more the boxplot's median tends to zero, and the boxplot is compact, the more the model is accurate. As a consequence, Figure 6 indicates that the GAHD-VAE provides better performance than all the other models. The obtained forecasting results are tabulated in Table 4. Results in Table 4 show that the quality of the forecast of pedestrian and bicycle traffic flows from the seven trained models is promising. Table 4 indicates that the proposed approach exhibited improved forecasting performance compared to other deep learning methods by achieving the lowest RMSE and MAE values and the highest \(R^{2}\) and EV values (close to 1). The averaged metrics by datasets of the proposed approach are RMSE of 3.35 and MAE of 2.54; the proposed model has reached a high fitting score with low forecasting error for pedestrians, and bicycle traffic flows using six datasets. This could be attributed to the GAHD-VAE capacity in handling nonlinearity. On the other hand, results demonstrate that bidirectional methods (i.e., BiLSTM and BiGRU) improved the quality of forecasting compared to the uni-directional models (i.e., LSTM and GRU). Moreover, the overall performance of BiLSTM is slightly better than BiGRU. Notably, the GAHD-VAE method shows promising capability for modeling complex temporal features in different datasets, especially pedestrian traffic flow (datasets 2 and 3), which is highly dynamic and nonlinear. Table 5 summarizes the aggregated performances of each approach. \(R^{2}\) implies that all deep learning approaches are providing good forecasting. In terms of all metrics computed, the proposed GAHD-VAE approach achieves the best forecasting with high efficiency and satisfying accuracy (i.e., \(R^{2}=0.96\), RMSE = 3.36). It is followed by BiGRU and BiLSTM, which achieve \(R^{2}=0.88\). Notice that a significant forecasting improvement was obtained using the GAHD-VAE approach compared to the other deep learning models.