## 4 Analysis of Experimental Results
### Experimental Results  
Using the prediction of the experimental process in Figure 2, the predicted and actual values of the obtained traffic flow are shown in Figure 4, where the predicted data flow is  
Figure 3: Distribution and ID of test points in the experimental road network. represented by a solid red line, and the actual flow is represented by a dotted black line. It can be seen in (a) in Figure 4 that the predicted traffic flow is in good agreement with the actual traffic flow. It can be seen in the two sub-graphs (b) and (c) that the errors in training and prediction are relatively small. The training error is basically kept between \(-5\) and \(5\) vehicles, and the test error is basically kept between \(-4\) and \(4\), which shows that the KNN-BILSTM model proposed in this study is suitable for traffic flow forecasting. To see the details of the prediction fit plot in Figure 4 more clearly, we screened the sample size of the model to \(96\) samples for prediction. The results are shown in Figure 5. In the figure, the \(y\)-axis represents the number of vehicles in each timestamp, and the \(x\)-axis represents the data output sample of the test set (the number of vehicles detected at each timestamp as a sample). Figure 4: Prediction results and true values. (a) The picture shows the comparison between the predicted flow and the real flow. (b,c) are two subgraphs: (b) is the training error map, and (c) is the prediction error map. In order to verify the influence of different K values in the KNN algorithm on traffic flow prediction, this paper selects the spatial correlation; that is, different values of K are selected for prediction. The results show that different K values have a significant impact on prediction performance. As can be seen in Figure 6, when k = 8, that is, the number of relevant detection points is 8, the effect is the best, and the loss value is the lowest. In order to more intuitively observe the data correlation between all detection points, we selected a total of 192 sample data from the first two days of all testing points for observation. It can be observed from bottom to top in Figure 7 that the amplitude of eight line segments, including target points, is small, indicating that the data structure correlation is strong. The amplitude of the above seven line segments is increasing, which can further prove the conclusion obtained when k = 8. At this time, the corresponding detection point numbers are 4465A, 4455A, 4459A, 4451L, 4470A, 4461L, 4453L, and 4475A, and they are all  
Figure 5: Screening one-day sample size prediction result. Figure 6: Loss values corresponding to different k values. To further evaluate the effectiveness of the KNN-BILSTM model, this paper selects MAE, RMSE, and MAPE as the evaluation indicators and selects the SVR, LSTM, GRU, KNN-LSTM, CNN-LSTM, and AT-convLSTM models as the comparison models for verification. By conducting 30 separate experiments on the 5 groups of models and encapsulating the experimental results, the average value of the evaluation indicators corresponding to the 30 groups of models is used for verification. The current literature on traffic flow can be roughly divided into two categories. The first is traffic flow prediction based on Euclidean space data, and the second is traffic flow prediction based on non-European space, such as convolutional neural networks and variants. In traffic flow prediction based on Euclidean space, KNN, and CNN, there are many studies on classic models, such as LSTM. With the popularization of attention mechanisms, more researchers have added attention mechanisms based on CNN, KNN, LSTM, and other models to improve and achieve better results. Therefore, we first selected the representative model of AT-ConvLSTM for comparison. Among them, for the AT-convLSTM model, two groups of experiments were carried out in this paper. One group was used to add a new dataset. The new dataset had the same structure as [25]'s dataset, and both belong to the public data of PEMS Expressway District 10.