# Studying Spatial Unevenness of Transport Demand in Cities Using Machine Learning Methods
## 2 Materials and Methods
### ANN Model Accuracy  
The network model was trained on the dataset \"Traffic\" on the training sample using the above parameters and tested on the validation sample, as a result of which the model error significantly decreased, which indicates the correctness of the selected parameters and the completion of model training. The model trained on the training set of data was used to predict the values of the mobility structure on the test set. The results of the first three values of the parameter ta predicted by the neural network--\"travel time in a loaded network, s\"--are presented in Table 2, in which the second column is the actual test data ta, and the third column is the data predicted by the model: ta_pred. Figure 2: ANN architecture for determining (a) the influence of traffic factors on travel time in a busy network, (b) patterns of population mobility, and (c) the share of trips of the population of the area by various modes of transport from the area and back. According to the correspondence of the values predicted by the model to the test ones, one can visually assess the accuracy of the model. Model accuracy was quantified using the r2_score, MSE, and explained_variance_score metrics, which are commonly used to assess the accuracy of regression models. The results of determining the metrics are presented as follows: r2_score: 0.99; MSE: 2.65; explained_variance_score: 0.99. Based on the results of determining the quality metrics of the model, we can conclude that the mathematical model is statistically significant. The model was trained on the Mobility dataset on the training set using the above parameters and tested on the validation set, as a result of which the model error significantly decreased, which indicates the correctness of the selected parameters and the completion of model training (Figure 3). The model trained on the training set of data was used to predict the values of the mobility structure on the test set. The results of the first three values predicted by the neural network are presented in Table 3, in which the first 4 columns are the actual test data, and the second 4 columns are the data predicted by the model: car_pred, bus_pred, bike_pred, ped_pred. According to the correspondence of the values predicted by the model to the test ones, one can visually assess the accuracy of the model. Model accuracy was quantified using the r2_score, MSE, and explained_variance_score metrics, which are commonly used to assess the accuracy of regression models. The results of determining the metrics are presented as follows: r2_score: 0.92; MSE: 19.90; explained_variance_score: 0.92. \begin{table}
\begin{tabular}{c c c} \hline \hline
**No.** & **ta** & **ta\_pred** \\ \hline
1 & 2776.8 & 2771.4 \\
2 & 1442.8 & 1443 \\
3 & 655 & 657 \\
4 & 1393.7 & 1393.7 \\
5 & 2366.1 & 2365.2 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of test data (2 nd column) and data predicted by the model (3 rd column). Figure 3: Change in the loss (errors) and accuracy (accuracy) metrics of the model for the training (blue) and validation (orange) samples according to the Mobility dataset. The model was trained on the dataset \"Areas\" on the training sample using the above parameters and tested on the validation sample, according to the results of which the model error significantly decreased, which indicates the correctness of the selected parameters and the completion of model training (Figure 4). After training and testing the artificial neural network model, a cluster analysis of city areas was performed. Cluster analysis was carried out to classify areas according to a number of criteria: distance from the city center, distance and time of travel by private and PT, parameters of transport demand. For cluster analysis, the self-organizing map method was used. The self-organizing map method (SOM) or Kohonen self-organizing maps are a type of neural network algorithm.