## 8 Completion of SSQ (SSQ4) and PQ questionnaires
### Data Preprocessing  
This research demonstrates how to apply some machine learning classification techniques, including K-Nearest Neighbor (KNN), Support Vector Machines (SVMs), and tree-based models based on Bootstrapping Aggregation methodology, comprising a single Decision Tree (DT) and Random Forest, to determine whether there will be a pedestrian collision based on the degree of attention, the road configuration and the pedestrian's reaction during the crossing. The data include the individual records for each user who performed the test (57 samples performed in total), thus considering the following features: percentage of time that the pedestrian is looking with a head rotation angle lower than the MAA (\"Percentage of attention time\", PAT); the reaction type, if any (Reaction type), the type of visibility, complete or reduced, (Visibility); the area where the reaction occurs (Reaction zone), taking as reference the lane in which the vehicle circulates; the average error committed when calculating the distance to real objects (Average error DR); the average error when calculating the distance to VR objects (Average error DVR) (Figure 7); the average error when calculating the vehicle speed in VR (Average error VVR); and the safety TTC. Errors are calculated as (actual value-estimated value)/(actual value). The preprocessing of the variables was conducted with Python and SPSS(r), while the model development was performed entirely in Python. The PAT variable, the TTC, and the errors in the calculation of distances and speeds are numerical variables, while the remaining are categorical variables. Similarly, the response variable \"Event\" is a discrete variable. Therefore, categorical variables must be transformed into numerical values to be analyzed by classification techniques, especially in the case of distance-based models. For the explanatory variables, the One-Hot Encoder (OHE) function has been used, while for the target value the LabelEncoder function has been applied, both contained within the Python module sklearn.preprocessing. The OHE function generates a binary column for each category, returning a sparse matrix, while LabelEncoder encodes the response variable by assigning values between 0 and nclasses-1, so that \"0\" is assigned for the label \"Avoidance\" and \"1\" for \"Collision\". Within the OHE function, it is specified that one of the categories should be dropped if the variable is binary, to reduce to some extent the effects of multicollinearity. For the distance-based classifiers, Feature Scaling is applied to the input variables, since the range of values of the variable \"PAT\" is different from the one considered in the new binary variables obtained from the encoding. For this purpose, a standardization of the variables is conducted to eliminate the mean and scale them to unit variance. By normalizing the features, it is avoided that those variables such as \"PAT\", which have a variance whose order of magnitude is greater than the rest, could be dominant in the objective function and cause the classifier not to learn correctly from the rest of the variables. Figure 7: VR scenario for estimating distances of different objects: cones, benches, trees, and vehicles. To determine whether two variables are related, some measures of association with their corresponding significance test must be used ([PERSON], 2018). The succeeding bivariate analysis and graphics have been implemented in SPSS(r) software. The method used for feature selection is derived from the minimum redundancy maximum relevance (mRMR) approach ([PERSON], 2018), consisting in selecting those features that are more correlated to the response variable and which are less correlated with each other. To determine the correlation statistic to be used between the numerical explanatory variables, the Kolmogorov-Smirnov (K-S) test with Lilliefors correction was performed.