Prediction and Classification of Vehicle Traffic Congestion in Bandung City Using the Random Forest and K-Nearest Neighbour Algorithm
Authors
| Issue | Vol. 11 No. 2 (2025) |
| Published | 1 December 2025 |
| Section | Articles |
| Pages | 90-110 |
Abstract
Traffic congestion remains one of the problems that continue to arise, especially in urban areas, one
of which is Bandung City, when the causes of the problem are not managed properly. Continuous
management of the causes of congestion problems will result in a controlled traffic system for the
foreseeable future. This condition can be achieved if there is a congestion classification prediction
system available. A reliable prediction and classification system can support the government in
formulating data-based traffic management strategies. The Random Forest and K-Nearest
Neighbour machine learning classification methods are strengthened with time-based feature
expansion to capture traffic behavior in various time frames, so that the objectives can be achieved.
The dataset obtained from Area Traffic Control System Bandung includes traffic flow recorded at
15-minute intervals at several intersections. Additional features such as red light duration, road
width, and spatial proximity to residential and commercial areas are included to improve model
performance. The results show that the Random Forest classifier with time-based feature expansion
outperforms K-Nearest Neighbors, achieving the highest performance of 96%. These results show
the potential contribution in short-term traffic prediction and its effectiveness in supporting urban
traffic planning and congestion mitigation efforts in Bandung.
