# Deciphering Autonomous Vehicle Regulations with Machine Learning
## 3 Methodology
### Data and Feature Engineering
Eliminating the aggregate variables encapsulated in the proportional variable helps to simplify model training without losing crucial information. The features labeled in Table 1 as \"derived\" are the proportional variables used for ML. Outlier removal is important for improving the accuracy of the statistical analysis because it can significantly affect the mean and standard deviation of the dataset, resulting in misleading interpretations. Models based on feature distance metrics or normality assumptions are sensitive to outliers. This analysis removed Alaska, Hawaii, and the District of Columbia (DC) because of their geographical anomalies. Canada separates Alaska from the contiguous United States (CONUS), and Hawaii is an island state in the Pacific Ocean. DC is a federal district of the United States and has a unique status and demographic profile compared with states. These regions are also statistical outliers based on their landmass, with Alaska and DC being the largest and smallest, respectively. Furthermore, DC has no rural interstate miles. These differences can introduce variations that are misaligned with the general patterns of CONUS states. Collinearity refers to the situation where two or more predictor variables of the ML model are highly correlated such that one is accurately predictable from the other. Hence, building ML models with highly correlated features can lead to overfitting, a condition where the model fits the training data well but fails to generalize in accurately predicting unseen data. Therefore, reducing multicollinearity by eliminating highly correlated variables increases the reliability, generalizability, and speed of training statistical models. This analysis used the Pearson correlation coefficient \(r\) as the measure of collinearity such that  
\[r=\frac{\sum(x_{i}-\overline{x})(y_{i}-\overline{y})}{\sqrt{\sum(x_{i}- \overline{x})^{2}\sum(y_{i}-\overline{y})^{2}}} \tag{1}\]  
where \(x_{i}\) and \(y_{i}\) are the individual samples, with \(\overline{x}\) and \(\overline{y}\) being their mean values, respectively. The numerator represents the covariance between the two variables and the denominator is the product of the standard deviations of the two variables. Hence, \(r\) quantifies the degree to which a change in one variable associates with a change in another variable, assuming a linear relationship. Standardizing the features to center the values around the mean with a unit standard deviation is a crucial preprocessing step for many ML algorithms. The transformation \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Category** & **Feature** & **Description** & **Source** \\ \hline \multirow{8}{*}{Transp.} & VMT\_HW\_B & State VMT on highways (billion miles) & [25] \\  & VMT\_HW\_B/(L\$qMi/1000) or B VMT per thousand sq. mi. land & Derived \\  & HW\_Fatals & Highway fatalities & [17] \\  & FATL\_POPOP & HW\_Fatals/POP\_M or fatalities per million population & Derived \\  & Truck\_Estab & Trucking business establishments & [17] \\  & Truck\_Emp & Trucking company employees & [17] \\  & TRKEpCO & Truck\_Emp/Truck\_Estab or employees per company & Derived \\  & Truck\_Pay\_M & Trucking company annual payroll in million dollars & [17] \\  & TRKEp\_P & Truck\_Pay\_M * 1E6/Truck\_Emp or truck pay per employee & Derived \\  & TRKpMPO & Truck\_Estab/MPO & Derived \\  & Agencies & Transit agencies & [26] \\  & POPKpTRA & Population (thousands) per transit agency & Derived \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._involves subtracting the variable mean and dividing by the standard deviation. Standardization makes the variables more comparable on the same scale, resulting in a more efficient and effective training process. Other benefits of standardization are the elimination of non-uniformity in measurement scales due to different units such as miles and tons, and reducing the influence of large values that can dominate the model's learning process and lead to biased results.