# Data-Driven Approaches for Predicting and Forecasting Air Quality in Urban Areas
## 3 Results
### ML and DL Model Results
The number of epochs used for training each DL method was established through experimental testing, respectively, through a trial-and-error testing process. The primary objective of this exploration was to ascertain whether these advanced DL techniques, implemented and tailored by the authors, could yield superior results compared to the traditional ML (implemented and customized by the authors or pre-implemented ML) approaches. By leveraging DL's capabilities to capture complex patterns and relationships within large datasets, we aimed to determine if these models could provide more accurate predictions of _AQI_ values, ultimately contributing to better AQ management and public health outcomes. Various performance metrics were utilized to assess the models, _including R\({}^{2}\)_, _MAE_, _MAPE_, and _MedAE_. Table 3 presents the algorithms' results for a training set of 912 entries and an evaluation set of 393 records. The total number of analyzed entries extracted from the custom SQL Server database is 1305, corresponding to the _AQI_ monitoring interval between 1 January 2020 and 31 December 2023. A comparative discussion regarding the best performance algorithm for ML versus DL is conducted regarding performance metrics and _OP_ indicators. RFR is the top performer among the fully customized algorithms. It achieves an impressive \(R^{2}\) of 0.9944, which indicates that it explains 99.44% of the variance in _AQI_ values. It has a low _MAE_ of 0.2237 and an _MAPE_ of 0.0068. These metrics demonstrate RFR's exceptional accuracy in predicting AQ. Its _OP_ is set to 0.95618, classifying the RFR algorithm as the most performant in _AQI_ prediction. In contrast, all the other implemented and customized ML algorithms exhibit a low-performance value for the _OP_ indicator, as all indicated a negative value, suggesting inadaptability to the _AQI_ problem. A negative \(R^{2}\) value indicates that the model is not suitable for the type of dataset and is unable to model the _AQI_ problem for the selected features. Usually, a negative \(R^{2}\) may indicate overfitting, underfitting, or inadequate data that include noisy features. However, the fact that the RFR model generates an \(R^{2}\) with an accuracy of 0.9944 suggests that the other models are unsuitable for the _AQI_ problem, given the selected features. Among the implemented DL algorithms, TCNs demonstrate the best performance, achieving an impressive \(R^{2}\) of 0.9934, a low _MAPE_ of 0.0172, and an exceptionally low _MAE_ of 0.5235. The _OP_ indicator set to 0.86275 indicates a high accuracy in predicting _AQI_ values compared to the other implemented and tailored DL algorithms. Compared to the two, RFR is the superior choice for _AQI_ prediction, with a higher \(R^{2}\) and lower _MAE_ and _MAPE_ than TCNs. This comparison illustrates the strengths of traditional ML models in achieving optimal performance for _AQI_ prediction. Overall, the findings highlight the importance of tailored algorithm selection, where RFR demonstrates superior performance in \(AQI\) prediction compared to the other models. Data in Table 3 outline that the DL models' prediction performance was inferior to that of the ML models. This can be explained by the dataset of 1305 records, which may be insufficient for the generalization of DL-type predictions. Due to computational constraints and time limitations, we did not fully explore every possible hyperparameter combination, which could explain the relatively lower performance. Future research will detail each model individually, but the present paper provides an overview of the most suitable algorithm for the particularities of the \(AQI\). The authors explain that RFR, as an ML model, outperforms all DL models because of the dataset size and complexity. DL models require large datasets. However, our dataset includes 1305 records. Extensive data could not capture the urbanization image, which has inherent implications for \(AQI\).