# Data-Driven Approaches for Predicting and Forecasting Air Quality in Urban Areas
## 3 Results
### ML and DL Model Results  
This study initially focused on implementing and evaluating several ML and DL algorithms to enhance the accuracy of _AQI_ predictions. The research includes a comparative analysis of six implemented and customized ML algorithms, seven implemented and customized DL algorithms, and six pre-implemented ML (ML.NET) models. For each of the six ML regression algorithms (RFR, DTR, LR, KNR, SVR, and GBR) that were implemented in Python 3.9 and customized by the authors for the analyzed problem (_AQI_ prediction) was achieved, first of all, a much needed primary data processing (missing values and outliers removing, normalization, data splitting into training, evaluation, validation sets, etc. ), followed by the configuration of each algorithm hyperparameters/parameters(such as the number of estimators, random state, maximum depth, learning rate, kernel type, number of neighbors, the minimum number of samples per split, intercept, maximum leaf nodes, loss function, etc.) for training and validating processes, parameters that are different from one model to another. Also, the best parameters were identified for each analyzed ML regression algorithm through an intensive trial-and-error testing process. The study explored seven DL models after identifying the top-performing ML model (implemented and customized by the authors or pre-implemented (ML.NET). Regarding the analyzed DL algorithms (FNNs, TCNs, RNNs, LSTMs, GRNNs, TDNNs, and DBNs) that were implemented in Python 3.9 and customized for the analyzed problem (_AQI_ prediction), in addition to a much-needed data preprocessing step, the following actions were taken:  
* For each customized DL algorithm (unlike the original algorithm), a dropout layer was added that ignores twenty percent of the data for network overfitting prevention, and in the case of some algorithms (for instance, for RNNs and LSTMs) was integrated a return sequence for better performances. Also, the input layer (the input shape) for some types of networks (for instance, for FNNs and GRNNs) was integrated into the network-dense layers. In contrast, for TCNs, the input shape was incorporated into the convolutional layers, with a standard kernel size of 2 and a causal type padding;
* For each customized DL algorithm, the number of layers (dense layers) of densely interconnected nodes (that are using ReLu or RBF), the number of nodes for each layer (for instance, FNNs contain nine layers of densely interconnected nodes that start at seven nodes and doubles in number up to two hundred and fifty-six nodes), the number of 1D Convolutional layers (for TCNs) that supplies the output filter starting from a number of four nodes to a number of two hundred and fifty-six nodes, and the number of flattening layers (for TCNs, such a layer being used to flatten the output to the correct size) were established. Also, the number of SimpleRNN layers (for RNNs, where the first layer contains thirty-two nodes with a return sequence, the second one has one hundred and twenty-eight nodes with a return sequence, and the third one includes two hundred and fifty-six nodes without a return sequence), the number of final layers that contains just one output (for instance, for DBNs and TCNs), and the number of layers of autoencoders (for example, for DBNs). Regarding the results supplied by the implemented and customized DL methods (FNNs, TCNs, RNNs, LSTMs, GRNNs, TDNNs, and DBNs), for correct comparison of them, we established the same number of trainable parameters (around one hundred and twenty thousand) that indicate the global parameters of the entire neural network (with the architecture, from the authors' point of view, presented in Figure 6). Respectively, for the components of each neuron in the proposed network and for the analyzed problem (_AQI_ prediction), the models were trained in one thousand epochs using the Adaptive Moment Estimation (ADAM) algorithm and the MSE function.