A Study on Short-Term Traffic Flow Prediction Based on Random Forest Regression

Authors

  • Jiong Wu

DOI:

https://doi.org/10.54097/tv6vfy08

Keywords:

Short-term Traffic Flow, Spatio-temporal Analysis, Data Destratification, Pearson Correlation Analysis, Random Forest Regressor.

Abstract

Accurate and rapid prediction of short-term traffic flow is of great significance for improving the efficiency of traffic management as well as alleviating the pressure of urban traffic. In this paper, the traffic flow data are first analysed in depth in terms of spatial and temporal patterns. In the time dimension, through the daily traffic flow statistics line graphs of the four junctions, it is found that the traffic flow of the No.1 junction shows an obvious trend of increasing year by year, while the traffic flow of the No.2, No.3, and No.4 junctions grows more gently without any significant incremental pattern. In addition, the weekly traffic flow line graphs reveal a clear pattern: the traffic flow from Monday to Friday is relatively high, while the traffic flow on Saturdays and Sundays is relatively low. In the spatial dimension, the violin distribution plots of the traffic flow in each junction reveal that the traffic flow in each junction shows a skewed distribution. Therefore, this paper employs Quantile Transformer for data preprocessing to eliminate this skewness. Next, this paper explores the correlation of traffic flow between different junctions using Pearson's correlation coefficient, and the results show that the traffic flow between junctions is extremely correlated. In order to predict the traffic flow, this paper tries three models, Lasso, Ridge and Random Forest Regressor, respectively, and searches for the optimal hyperparameters of the above models through cross validation grid search. Finally, four evaluation metrics, namely, Mean Absolute Error (MAE), Mean Square Error (MSE), Root Mean Square Error (RMSE), and Coefficient of Determination R2, were used to comprehensively evaluate the prediction accuracy of the models. Eventually, it returned that the Random Forest Regressor model performed the best in terms of prediction results, with an MAE of 17.315, an MSE of 4.161, an RMSE of 2.458, and an R2 of 0.96.

Downloads

Download data is not yet available.

References

Kaili Z, Hailong Z, Jingyu L, et al. Traffic flow prediction based on graph convolutional neural network[J].Intelligent Computer and Applications, 2019.

Fix. The design of the intelligent traffic management information system [J]. Integrated circuit applications, 2024, 9 (02): 298-299.

Hu Xiaoyong, Zhang Jianjun, Yang Yun Hui, et al. Based on the nonlinear model predictive control of urban road network traffic flow optimization [J]. Journal of modern electronic technology, 2023, 46-48 (20)

Li C, Ren X, Zhang Q, et al.Short-term Traffic Flow Prediction Based on Improved Deep Echo State Network[J].IEEE[2024-04-25].

YAO Xu. Research on Forecasting method of urban Road Traffic demand in winter in Cold region [D]. Harbin Institute of Technology, 2014.

Janessa Yin. Based on moderate traffic impact assessment of traffic simulation study [D]. Shenzhen University, 2021.

Xiao Pei cheng, Cao Yang, Shen Qinqin, et al. Short-time traffic flow prediction by spatio-temporal graphical convolutional network based on ARMA filter [J/OL]. Computer Engineering and Applications:1-7[2024-04 05]

XIA Jin, WANG Zhengqun, ZHU Shiming. A traffic flow prediction model based on time series decomposition [J]. Computer Applications, 2023, 43(04):1129-1135.

Liu Fan. Several studies about skewed distribution [D]. Chang'an University, 2017. [10] Li Y, Zhang Chunxia. Hyperparameter estimation of random forest algorithm based on out-of-bag samples [J]. Journal of Systems Engineering, 2011, 26(04):566 572.

Downloads

Published

15-08-2024