Predicting short-term traffic with random forest: a granular data approach

Ahmad Mustafa, Khurram Shehzad Khattak, Zawar Hussain Khan · IET conference proceedings. · 2025

Accurate short-term traffic flow prediction is critical for improving the efficiency of Intelligent Transportation Systems (ITS), particularly in heterogeneous traffic environments. This paper presents a data-driven model based on the Random Forest (RF) algorithm to predict traffic flow using high-resolution data collected over a week. The dataset encompasses individual vehicle speed, vehicle classification (car, bicycle, motorbike, bus), timestamp, flow rate, peak hour factor, traffic density, time and distance headway, and density range, recorded from 9 AM to 5 PM over seven consecutive days. Six days of data are used for training the RF model, with Thursday’s traffic flow serving as the test case. The dataset features high-dimensional, heterogeneous traffic attributes, enabling the model to capture non-linear and complex interactions effectively. Our results demonstrate that the RF model effectively captures complex, non-linear relationships in the data, delivering highly accurate predictions with an R-squared value of 0.997. This study contributes to advancing machine learning applications in traffic management, emphasizing the importance of feature selection in enhancing model performance. Future research will investigate the inclusion of additional factors such as weather conditions and external events to further refine prediction accuracy.

Read the paper · More papers on PaperTik