# STFEformer: Spatial-Temporal Fusion Embedding Transformer for Traffic Flow Prediction
## 4 Experimental Results and Discussion
### Ablation Study Results
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline  & **3** & \multicolumn{4}{c}{**6**} & \multicolumn{4}{c}{**9**} & \multicolumn{4}{c}{**12**} \\
**Model** & **MAE** & **RMSE** & **MAPE** & **MAE** & **RMSE** & **MAPE** & **MAE** & **RMSE** & **MAPE** & **MAE** & **RMSE** & **MAPE** \\ \hline w/o MaskSSA & 14.72 & 23.79 & 9.70\% & 15.48 & 25.37 & 10.23\% & 16.34 & 26.53 & 10.77\% & 17.08 & 27.95 & 11.62\% \\ w/o mask & 14.17 & 22.93 & 9.20\% & 15.02 & 24.56 & 9.92\% & 15.64 & 25.88 & 10.38\% & 16.53 & 26.83 & 11.10\% \\ w/o \(E_{sp}\) & 14.82 & 23.17 & 9.65\% & 15.57 & 25.96 & 10.16\% & 17.05 & 27.56 & 11.16\% & 17.97 & 28.09 & 12.20\% \\ w/o \(E_{f}\) & 14.42 & 22.97 & 9.38\% & 15.28 & 25.02 & 9.99\% & 15.78 & 26.29 & 10.66\% & 16.79 & 27.11 & 11.24\% \\ w/o \(E_{t}\) & 14.91 & 23.99 & 9.70\% & 15.71 & 26.38 & 10.25\% & 17.31 & 28.06 & 11.34\% & 18.82 & 29.00 & 12.31\% \\ STFEformer & 13.88 & 22.43 & 9.13\% & 14.83 & 24.36 & 9.82\% & 15.34 & 25.38 & 10.24\% & 16.27 & 26.60 & 10.87\% \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The next 3-, 6-, 9-, and 12-time-step prediction results of the ablation study on PeMS08. Figure 3: The overall 12-time-step prediction results of the ablation study on PeMS07. (**a**) MAE. (**b**) RMSE. (**c**) MAPE. Figure 2: The overall 12-time-step prediction results of the ablation study on PeMS04. (**a**) MAE. (**b**) RMSE. (**c**) MAPE. Figure 4: The overall 12-time-step prediction results of the ablation study on PeMS08. (**a**) MAE. (**b**) RMSE. (**c**) MAPE. Figure 5: The next 3-, 6-, 9-, and 12-time-step prediction results of the ablation study on PeMS04. (**a**) MAE. (**b**) RMSE. (**c**) MAPE. Figure 6: The next 3-, 6-, 9-, and 12-time-step prediction results of the ablation study on PeMS07. (a) MAE. (b) RMSE. (c) MAPE. Figure 7: The next 3-, 6-, 9-, and 12-time-step prediction results of the ablation study on PeMS08. (a) MAE. (b) RMSE. (c) MAPE. In predicting the next overall 12 time steps, STFEformer achieved enhancements in MAE, RMSE, and MAPE when contrasted with w/o \(E_{sp}\). On the PeMS04 dataset, STFEformer demonstrated enhancements of 12.3% in MAE, 10.6% in RMSE, and 7.2% in MAPE. Similarly, on the PeMS07 dataset, the enhancements were 10.6%, 9.2%, and 6.1% in MAE, RMSE, and MAPE, respectively. On the PEMS08 dataset, the enhancements were 5.7%, 7.7%, and 5.1% in MAE, RMSE, and MAPE. Moreover, in the prediction of the next overall 12 time steps, STFEformer exhibited enhancements on different datasets when contrasted with w/o \(E_{f}\). For instance, the improvements were 5.7%, 4.8%, and 3.5% in MAE, RMSE, and MAPE on the PeMS04 dataset; on the PEMS07 dataset, the improvements were 4.9%, 5.2%, and 3.7; and the improvements were 3.8%, 3.5%, and 3.6% on the PEMS08 dataset, respectively. Furthermore, compared to w/o mask, STFEformer showed an improvement in next overall 12-time-step prediction. Specifically, on the PeMS04 dataset, STFEformer improved by 1.7%, 1.4%, and 2.5% in MAE, RMSE, and MAPE, respectively. The enhancements were 1.9%, 1.8%, and 1.2% on the PeMS07 dataset, while STFEformer improved by 1.2%, 1.4%, and 2.0% on the PeMS08 dataset. Finally, compared to w/o MaskSSA, STFEformer showed great improvements. For instance, on the PeMS04 dataset, STFEformer improved by 8.5%, 7.8%, and 5.9%; on the PeMS07 dataset, the improvements were 7.8%, 7.6%, and 4.6%; and on the PeMS08 dataset, STFEformer improved by 4.8%, 4.7%, and 4.5%. In predictions of the next 15, 30, 45, and 60 min, STFEformer also outperformed all the models post-ablation. The ablation experiments provide crucial evidence regarding the effectiveness of each component proposed in our research. Through the fusion embedding layer, we successfully achieve comprehensive feature extraction and fusion, significantly enhancing the model's accuracy for traffic flow prediction tasks. The design of the fusion embedding layer enables the model to extract native information and spatial-temporal characteristics from traffic data more effectively, leading to more accurate prediction.