# An LSTM-Based Method Considering History and Real-Time Data for Passenger Flow Prediction
## 4 Results and Discussion  
The train dataset used was extracted from October 1, 2015 to October 25, 2015. The test dataset was from October 26, 2015 to October 30, 2015. The two lines were 685 and 56008. Line 56008 has a large passenger volume, because it is a major bus line on the third ring road. Line 685 is a normal line which has a relatively small passenger volume. We chose these two lines to evaluate the performance of the HRPFP model in different scales. These two lines are shown in Figure 6.  
Here, we chose the root mean square error (RMSE) as an evaluation for the service radius configuration part. The RMSE can be calculated by Equation (19). \[RMSE=\sqrt{\frac{1}{M}\sum_{m=1}^{M}\abs{y_{m}-\widehat{y_{m}}}^{2}} \tag{19}\]  
where \(M\) is the total number of samples, \(y_{m}\) is the true value, and  
Figure 8: The RMSE and distance of the best service radius configuration part in the HRFFP model for line 685. Figure 7: The RMSE and distance of the best service radius configuration part in the HRFFP model for line 56008.  
two models can reflect the daily passenger flow trend. The HRPFP model performed better than the LSTM and time series models in this station. In the same time periods, the predicted passenger number using different models for the major on-board station (the 7 th station) of line 685 are shown in Figure 10. Due to the passenger number being small at this station, the passenger data fluctuated strongly. Therefore, the time series model cannot find this regularity effectively. The LSTM model can only find part of this regularity. The HRPFP model was more accurate than the other two models due to the addition of POI features and, especially, the real-time data information. Figure 10: The comparison of three methods in passenger flow prediction using data from 7:00 to 9:00 for the 7 th station in line 685. Figure 9: The comparison of three methods in passenger flow prediction using data from 7:00 to 9:00 for the 8 th station in line 56008. We extended the time period to 7:00-12:00. From Figure 11, we can see that due to the irregular fluctuation of daily passenger flow from 10:00 to 12:00, the performance of the HRPFP model was significantly better than the LSTM model and the time series model at the 8 th station in line 56008. The performance of the HRPFP model was also the best at the 7 th station in line 685, as shown in Figure 12. However, the time series model performed a bit better than the LSTM model at the 7 th station in line 685. We believed the major reason for this phenomenon was that the changing amplitude of the passenger flow at this station was smaller than that at the 8 th station in line 56008, and the LSTM model overfitted. Besides the comparison with these two sequence models at a certain station, we also compared the HRPFP model with the Xgboost model and the SVM model in bus passenger flow prediction for the lines. Using the time series model in passenger number prediction for the lines required establishing a prediction model for each site. The organization process of the time series model was too complicated, so we did not choose the time series model as a baseline in bus passenger flow prediction for the lines. Figure 11: The comparison of three methods in passenger flow prediction using data from 7:00 to 12:00 for the 8 th station in line 56008. Figure 12: The comparison of three methods in passenger flow prediction using data from 7:00 to 12:00 for 7 th station in line 685. Besides RMSE, we also used MAE and MaxError as the evaluation for different methods. The MAE can be calculated by Equation (20). \[RMSE=\sqrt{\frac{1}{M}\sum_{m=1}^{M}\abs{y_{m}-\widehat{y_{m}}}^{2}} \tag{19}\]0  
\[RMSE=\sqrt{\frac{1}{M}\sum_{m=1}^{M}\abs{y_{m}-\widehat{y_{m}}}^{2}} \tag{19}\]1  
where \(M\) is the total number of samples, \(y_{m}\) is the true value, and \(\hat{y_{m}}\) is the predicted value. The MaxError can be calculated by Equation (21).