# Analysing Urban Traffic Patterns with Neural Networks and COVID-19 Response Data
## 3 Methodology and Data
### Methodology of the Study
#### 3.2.2 Methodology of Modelling--Artificial Neural Networks
A common problem with MLP neural networks is overfitting, or \"over-adaptation to the data\" from the training dataset. This problem is typical for most machine learning tools. To eliminate the problem of overfitting, the dataset is divided into a training and testing part. The data cases from the training set are used to validate the predictive ability of the neural network. The remaining data cases (training set) are presented to the neural network as learning patterns. The network learns to create connections between neurons on these patterns so that its response, i.e., outcomes, closely approximates the actual or desired outcome. The neural network must then be able to generate responses based on the acquired knowledge for cases that were not a part of the learning process. And this is precisely the generalisation ability verified on the validation (testing) set. The training process ends if the resulting prediction error is approximately the same and sufficient for both sets. However, suppose the prediction error on the validation set is significantly lower and/or insufficient. In that case, another iteration (epoch) of learning follows, using the knowledge gained in the previous epochs to adjust the network (especially synaptic weights). This iterative learning process ends when the network achieves the desired generalisation ability on the validation set. The gradient descent method was used to find synaptic weights, minimising the error function (prediction error) at each step of the solution search. Finding the global minimum of the error function using this iterative method significantly depends on the so-called learning rate \(\eta\). With relatively  
Figure 7: Mathematical model of an artificial neuron. Source: [51; 52]. large values of this parameter, we risk \"skipping\" the sought global minimum, and on the other hand, with small values of this parameter, we risk slow convergence to this minimum. Therefore, the optimal value of this coefficient is also determined in individual steps of neural network learning. Finally, the model is deployed on the testing set, i.e., on cases not used in the learning process, and the resulting predictive evaluation metrics are determined. Neural network models generated predictions for the number of vehicles across all cases in the dataset, including those in the testing subset. Predictions for the testing data were produced using a model that had not been trained on them, allowing for an independent evaluation of the model's quality by comparing these predictions with actual outcomes. Consequently, this study presents the model quality assessment results exclusively for the testing data. With sufficient cases in the dataset, the division into training and testing subsets was done randomly at a 50:50 ratio. The models in this study were developed as ensemble models using neural networks. Ensemble models typically fall into two categories: bagged and boosted. _Boosting_ entails training a series of models sequentially, where each subsequent model is trained to correct the errors of the previous one. _Bagging_, on the other hand, involves training multiple models independently on different subsets of the training data, with their individual predictions aggregated. Combining the predictions from these model sequences generates a final prediction that is more accurate and robust than the predictions of any single model. Combining individual models into a composite model can be achieved through several methods. The most commonly used techniques include:  
* _Stacking_: This method involves training multiple models and then using a meta-model to combine their predictions. The meta-model uses the predictions from each base model as explanatory variables to generate the final prediction. * _Competition_: In this approach, the prediction with the highest reliability (confidence) is selected from the individual predictions of each model for each case in the data. * _Voting_: This method combines individual models by averaging their predictions.