# Studying Spatial Unevenness of Transport Demand in Cities Using Machine Learning Methods
## 2 Materials and Methods
### Data Preparation  
Technically, the process of developing neural network models was implemented using the Python programming language in the IPython programming environment using the Jupyter Notebook (V. 7.0.6). The initial data and their output were processed using the numpy and pandas frameworks. The results were visualized using the Matplotlib package and Seaborn. For the direct development of the model, the keras, tensorflow, and sklearn libraries were used. To process the data before creating the model, the StandardScaler module of the sklearn.preprocessing package was used. To split the data into training and test sets, the train_test_split module of the sklearn.model_selection package was used. For stepwise development of the model, the Sequential and Dense modules of the keras.models and keras.layers packages were used. The plot_model module of the tensorflow.keras.utils package was used to visualize the model architecture. To save and load neural network models and standarizers, the load_model modules of the keras.models package and the dump and load modules of the joblib package were used. To determine the accuracy metrics of the model, the r2_score, mean_squared_error, and explained_variance_score modules of the sklearn.metrics package were used.  
Before further work with the data, the datasets were checked for empty values in the cells, and the rows with empty values were deleted using the df.isnull() and df.dropna() methods, respectively.  
Before developing the architecture of the neural network and carrying out its training, the data were divided into the training and test sets, and the data were also standardized using the sklearn.preprocessing.StandardScaler module. Standardization involves scaling the data around zero, subtracting the sample mean from the actual value, and dividing the result by the standard deviation. Thus, all variables will have the same order of values before being placed in the model, which will improve the accuracy of the model.  
The train_test_split function of the sklearn.model_selection module with test_size = 0.3, random_state = 42 parameters was used to form the training and test sets. For example, for the \"Structure of mobility\" dataset, the size of the training sample for independent variables (X) was 97,262 observations, and the test sample was 41,685 observations. The validation set was formed from the test set within the additional arguments of the model.fit function of the keras.models framework.  
The procedure for working with standardized values is as follows: The actual values of the independent variables (X) of the training sample are standardized and then placed in the model for its training. The predictive value is also generated by the model in a standardized form and requires conversion to absolute values for its interpretation. To test the accuracy of the model, test values are also standardized and placed in the model to form a prediction. After the forecast for comparison with the initial data is received, the test values are standardized in the original form.