# A Comparative Analysis for Air Quality Estimation from Traffic and Meteorological Data
## 2 Materials and Methods
### Methodology  
The main objective of this study is the estimation of an Air Quality Index (AQI) in an urban environment, exploiting data related to vehicle transits and meteorological features. While the process can be defined as a standard classification task using AQI levels as target categories, we opted instead for the definition of a regression problem over pollutants in order to assess the validity of the solution on each target variable. Moreover, the latter configuration can be reduced to a classification problem by computing the AQI over the regression result. The AQI estimate is computed in two steps:  
Figure 4: Autocorrelation for the hourly pollutants considered in the case study, over a time window of 72 h.  
Figure 3: Correlation matrix between target variables and selected features. (i) independent estimation of each pollutant (\(NO_{2}\), \(NO_{x}\), \(C_{6}H_{6}\), \(CO\), \(BC\), \(O_{3}\) at hourly resolution, and \(PM_{10}\), \(PM_{2.5}\) at daily resolution), and (ii) computation of the AQI according to the official European formula, by using the estimates of each pollutant. The approaches proposed for the aforementioned steps were evaluated with different dataset configurations, considering weather and traffic features at (i) time \(t\), (ii) from time \(t-24\) to time \(t\), and (iii) from \(t-48\) to time \(t\). Formally, we can define this multi-step prediction pipeline as follows: given a set of aggregated features from two different domains, namely meteorological measurements \(\phi_{m}\) and vehicle transit counts \(\phi_{v}\), temporal features \(\phi_{t}\), and a machine learning model \(g\) with parameters \(\theta\), the objective is to first provide an estimate \(\hat{y}_{t}^{t}\), \(1\leq i\leq n\) for each pollutant \(i\) and time step \(t\) on the test set, such that \(\hat{y}_{t}^{t}=g_{i}(\phi_{m}^{t},\phi_{v}^{t},\phi_{t}^{t},...,\phi_{m}^{t- w},\phi_{v}^{t-w}|\theta_{i})\), where \(w\) indicates a specific time window. Obtained the estimates \(\hat{y}_{t}^{t}\), \(\forall i\wedge t\), the goal to evaluate a single global measure of air quality over the same data for each time step, named Air Quality Index (AQI), defined as \(k^{t}=AQI(y_{1}^{t},y_{2}^{t},...,y_{m}^{t})\) where \(m\leq n\) is a subset of the original pollutants and \(k\in[0,K]\) is a single integer value indicating the gravity of the air pollution. Specifically, we adopted a common European Air Quality Index (CAQI) which provides five different levels of severity based on three pollutants, namely \(NO_{2}\), \(O_{3}\) and \(PM_{10}\), as detailed in Section 2.5. Given the data described above, we trained the same set of regressors on every available feature for each pollutant. Specifically, we selected for this work four models with different characteristics: (i) a linear regressor with Bayesian Ridge Regularization, (ii) a Neural Network Using Bayesian Regularization (BRNN) (iii) a Random Forest Regressor (RF) [18], an ensemble model using decision trees as base estimators, and (iv) a Long-Short Term Memory (LSTM) model [19]. The first linear model can be seen as a standard Ordinary Least Squares (OLS) algorithm, with the addition on a regularization process that minimizes the weight estimates, therefore reducing the influence of strong outliers in most situations. In this particular case, the regularization uses a probabilistic approach similar to ridge regression, where the weights are assumed to follow a normal distribution around zero. Linear models represent the best compromise between performance and efficiency, for this reason they are typically employed as robust baseline [20]. Together with the linear model, we included a simple Neural Network with Bayesian Regularisation (BRNN) as second baseline. The motivation behind this model is twofold: first of all, previous work [15] had already shown encouraging results using this architecture. Second, it provided a good comparison between standard multi-layer perceptrons and recurrent neural networks.