## 5 Model Evaluation
### Model Experiment 1: Speed Prediction  
The data for speed and traffic volumes were divided into 60% training data and 40% testing data. The mean absolute percentage error (MAPE) was used to calculate the accuracy of the model prediction for different time horizons. MAPE measurements were used to calculate the average absolute difference between the predicted output from the model (Y1) and the expected true output (Y):  
\[\text{MAPE}\left(\%\right)=\frac{\left(\frac{1}{n}\!\sum_{i=1}^{n}\frac{ \left|Y-Y_{1}\right|}{Y}\right)\times 100 \tag{7}\]  
\[\text{Accuracy (\%)}=\left(100-\text{MAPE}\right) \tag{8}\]  
The speed results from the northbound direction (Table 3) show that BiLSTM provided the least MAPE (%) error and the best accuracy of 99% from the 15-min to the 60-min \begin{table}
\begin{tabular}{l c} \hline \hline \multicolumn{1}{c}{**Parameters**} & **Values** \\ \hline
**Gradient decay factor** & 0.9 \\ \hline
**Initial learning rate** & 0.005 \\ \hline
**Minimum batch size** & 128 \\ \hline
**Maximum epochs** & 300 \\ \hline
**Training optimiser** & Adaptive moment estimation optimiser \\ \hline
**Dropping learning rate during training** & Piecewise \\ \hline
**Learning rate drop period** & 125 \\ \hline
**The factor for the learning rate dropping** & 0.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Model hyperparameters for Uni-LSTM and BiLSTM. Figure 7: Traffic flow and speed prediction with one input layer. Source: authors. prediction horizon. The second-best model was Uni-LSTM, with an accuracy above 90% for up to a 60-min prediction horizon. For both LSTM models, the accuracy did not deteriorate substantially as the prediction horizon increased, showing the ability of the system to capture the complexity of longer speed prediction horizons. On the other hand, the RNN and Elman models provided an accuracy above 85% for up to 60-min prediction horizons, and they provided better accuracy than the DLBP model for up to 45-min prediction horizons. DLBP provided a better prediction accuracy for a longer speed prediction horizon of 60 min into the future, with an accuracy of 87%. However, the DLBP model had the lowest performance of less than 85% from 15-min to 45-min prediction horizons. A similar result can be noticed for speeds from the southbound direction (Table 3). The green cells represent the best-performing models, while the yellow cells represent the worst-performing models. It shows that BiLSTM provided the least MAPE (%) error and the best accuracy of 99% from a 15-min to a 60-min prediction horizon. As above, the second-best model was Uni-LSTM, with an accuracy above 87% for up to a 60-min prediction horizon. On the other hand, the RNN and Elman models provided an accuracy above 81% for up to 60-min prediction horizons, and they provided better accuracy than the DLBP model for up to 45-min prediction horizons. At the same time, DLBP provided a better prediction accuracy for a longer speed prediction horizon of 60 min into the future with an accuracy of 83%. However, the DLBP model had the lowest performance among all models from 15-min to 45-min prediction horizons. The best speed prediction performance from the BiLSTM model is illustrated in Figures 9-12. The black dashed line represents the target real-speed data compared to the green trendline, which represents the results generated from the model. In the figures below, the \(x\)-axis represents the time period of data collection (in minutes), while the \(y\)-axis shows the speed and volume of observations. The figures compare the target values (black dashed line) with the prediction values from the developed model (green lines). Figure 8: Traffic flow and speed prediction with multiple input layers. Source: authors. Figure 10: Speed prediction results for 30-min horizons using the 4-BiLSTM model. Source: authors. Note: The first 500 conservative data points in the northbound direction were selected for presentation.