Traffic Volume Prediction Using Temporal and Weather Features with Explainable Machine Learning
Abstract
Accurate traffic volume prediction is essential for effective traffic management and transport planning, particularly on major freeway corridors. This study examines hourly traffic volume prediction using the Metro Interstate Traffic Volume Dataset by applying classical machine learning models together with systematic feature analysis and Explainable Machine Learning (ML). Temporal features derived from timestamps and selected weather variables were used to train four regression models: Linear Regression, Support Vector Regression, K-Nearest Neighbors, and XGBoost. A structured backward feature elimination approach was applied at the feature-group level to explicitly compare the predictive contributions of temporal (hour-of-day, day-of-week, month) and weather variables (temperature, rainfall, cloud coverage). The results show that XGBoost, KNN, and SVR outperform linear regression, with XGBoost achieving the best performance (RMSE = 479.07 vehicles/hour, R2 = 0.94). Quantitative analysis using the XGBoost model reveals a clear contrast between feature groups: removing weather features results in an RMSE change of less than 1%, whereas removing temporal features, such as day-of-week, increases RMSE by up to 94%. To improve interpretability, SHapley Additive exPlanations (SHAP) were applied to the XGBoost model, to acquire clear global and local explanations of predictions. The explainability results confirm that traffic patterns are mainly driven by recurring human activity rather than short-term weather effects for this research. By combining robust modeling with Explainable ML, this research moves beyond mere accuracy to provide transparent, actionable insights. These findings equip urban and transport planners with the quantitative evidence needed to prioritize peak-hour demand management and develop focused, evidence-based congestion mitigation strategies. While this specific study is limited to continuous-flow freeway data from the USA, future work will validate the framework using additional datasets from different geographic regions and functional road classifications, with a particular focus on expressways and urban road networks.