In this paper, we explore the impact of changes in traffic flow on local air pollution under specific meteorological conditions by integrating hourly traffic flow data, air pollution data and meteorological data, using generalized linear regression models and advanced machine learning algorithms: support vector machines and decision trees. The geographical location is Oslo, the capital of Norway, and the time we selected is from February 2020 to September 2020; We also selected 24-hour data for May 11 and 16 of the same year, representing weekday and holiday traffic flow, respectively, as a subset to further explore. Finally, we selected data from July 2020 for robustness testing, and algorithm performance verification.We found that: the maximum traffic flow on holidays is significantly higher than that on weekdays, but the holidays produce less concentration of {NO}_x throughout the month; the peak arrival time of {NO}_x,\ {NO}_2and NO concentrations is later than the peak arrival time of traffic flow. Among them, {NO}_x has a very significant variation, so we choose {NO}_x concentration as an air pollution indicator to measure the effect of traffic flow variation on air pollution; we also find that {NO}_xconcentration is negatively correlated with hourly precipitation, and the variation trend is like that of minimum air temperature. We used multiple imputation methods to interpolate the missing values. The decision tree results yield that when traffic volumes are high (>81%), low temperatures generate more concentrations of {NO}_x than high temperatures (an increase of 3.1%). Higher concentrations of {NO}_x (2.4%) are also generated when traffic volumes are low (no less than 22%) but there is some precipitation ≥ 0.27%.In the evaluation of the prediction accuracy of the machine learning algorithms, the support vector machine has the best prediction performance with high R-squared and small MAE, MSE and RMSE, indicating that the support vector machine has a better explanation for air pollution caused by traffic flow, while the decision tree is the second best, and the generalized linear regression model is the worst.The selected data for July 2020 obtained results consistent with the overall dataset.