## 2 Materials and Methods
### Machine Learning Methods for Scenario Extraction  
Supervised and unsupervised machine learning methods are particularly relevant in the context of accident data analysis. Commonly used supervised learning algorithms on accident data are classification and regression decision trees (CART), random forest, k-nearest neighbors (k-NN) and support vector machines. Supervised machine learning algorithms applied on accident data frequently have an aim to build a model in order to predict accident-related output features based on given inputs; for example, the prediction of the injury severity of the passengers based on the technical crash severity. [PERSON] et al. present an approach to the classification of motor vehicle crash injury severity [16]. [PERSON] et al. propose a supervised machine learning model to predict crash injury severity based on 15 crash-related parameters [17]. However, supervised learning algorithms require labeled training data to build a mathematical model. Unsupervised learning, on the other hand, aims to learn patterns from unlabeled data. In contrast to supervised learning, there is no separation between the training and testing data sets; all data is used for model training. One of the main applications of unsupervised learning on traffic accident data is the extraction of unobserved patterns from accident events. A commonly used unsupervised machine learning technique is cluster analysis or clustering. Cluster analysis is an exploratory data analysis technique, which aims to separate a dataset into groups as different as possible, while the data points within the groups should be as similar as possible. The fundamental concepts of clustering and clustering results validation techniques are presented by [PERSON], [PERSON] and [PERSON] [18]. The main groups of clustering methods are partitioning clustering, hierarchical clustering, density-based clustering, model-based clustering and spectral methods. The most well-known clustering method is the K-means algorithm, which performs iterative steps to assign data points to clusters based on the previously defined number of clusters k.  
Since no labels are used, the evaluation of unsupervised learning results appears to be a challenging problem. The evaluation is not a universal procedure and depends on the used data in the first place. Different evaluation metrics can be applied. The three main approaches to investigate cluster validity are based on external, internal and relative criteria. For external criteria, pre-specified benchmark data are needed, for example externally provided labeling. The internal criteria clustering validity approach involves the vectors of the data set themselves. It is based on characteristics such as cohesion, separation, distortion and likelihood. The common internal metrics are silhouette coefficient or the Davies-Bouldin index. The third, relative criteria approach evaluates a clustering structure by comparing it with other clustering results produced using the same algorithm but with different parameterization, for example a different number of clusters. In order to understand the distortion and silhouette score algorithms used in chapter 3 to evaluate the clustering results, the mathematical foundations behind them are explained. First of all, the terms cluster cohesion and separation are introduced. Cluster cohesion is an intra-cluster similarity score, which measures how closely related the data points in the cluster are. It is measured by the within-cluster sum of squares (WCSS). \[\text{WCSS}\ =\ \Sigma_{\text{k}}\ \Sigma_{\text{i}}\left(\text{x}_{\text{i}}- \ \text{c}_{\text{k}}\right)^{2} \tag{1}\]  
with:  
* \(\Sigma_{\text{k}}\): the sum over all clusters k
* \(\Sigma_{\text{i}}\): the sum over all data points i within cluster k
* \(\text{x}_{\text{i}}\): a data point within cluster k \(\epsilon_{k}\): the cluster center of cluster k  
Cluster separation is an inter-cluster dissimilarity score, which measures how well separated the cluster are. It is measured by the between-cluster sum of squares (BSS).