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

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.

Authors

Institutions

Publication Details

Journal
Highlights in Science Engineering and Technology
Published
2024-08-15
DOI
https://doi.org/10.54097/tv6vfy08
Primary Topic
Traffic Prediction and Management Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Jiong Wu
Highlights in Science Engineering and Technology
Traffic Prediction and Management Techniques
article

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

Jiong Wu
article en

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.

Highlights in Science Engineering and TechnologyVol. 107
Harbin University (CN), Harbin Engineering University (CN)
Sustainable cities and communities
Openalex Percentile: Top 86%
Traffic Prediction and Management Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.