# Driver Clustering Based on Individual Curve Path Selection Preference
## 2 Methods and Materials
### Parameter Clustering  
After the parameters of the model are calculated, they are used to cluster drivers into driver groups. Clustering is one of the most important techniques within the field of unsupervised learning and is used to group similar data points based on a distance metric. Three main types can be distinguished within clustering methods: hierarchical, center-based, and density-based clustering. In this paper, the center-based K-means clustering method is chosen [20], which is also used by many similar papers [13; 14; 15; 21]. This method aims to choose a centroid for the parameters, which minimizes the criterion known as inertia. The K-means algorithm has one hyperparameter \(K\), the number of clusters to be calculated. Choosing the right value of \(K\) is either heuristic (i.e., decision on cluster number as an empirical value), or optimizing an appropriately selected performance indicator. One of the most widely accepted indicators of the clustering performance is the silhouette coefficient [22]. The silhouette values for each sample in the dataset are calculated. The higher the average silhouette value for all elements, the better the clustering performance. The minimal requirement, which is often proposed by the literature, is to choose a value of \(K\) such that at least one element in each cluster would exceed the average silhouette value for all elements. Besides the hyperparameter \(K\), the performance of the K-means algorithm is highly influenced by the choice of the distance calculation method. The distance of the elements in a multi-dimensional space is given by the norm of the error vector between the two elements. The most often used normalization methods are Euclidean (\(\ell_{2}\)) norm and the Manhattan (\(\ell_{1}\)) norm. As a result of clustering, each element of the input set is assigned to one specific cluster. In this application, the clustering equally means grouping the drivers who have a similar curve path selection policy. These drivers are then characterized by one behavior mode, which is given by the centroid of the cluster. Let us transform the parameter matrix \(P\) into a parameter vector:  
\[p=\left[P[:,1]^{\top}\quad P[:,2]^{\top}\quad P[:,3]^{\top}\right]^{\top}\in \mathbb{R}^{18} \tag{24}\]  
It is noted that (24) is calculated for each driver individually, resulting in an individual parameter vector \(p^{\text{dn}_{i}}\) for the \(j^{\text{th}}\) driver from the reference dataset. After clustering, there are \(K\) number of clusters. Let us denote the elements of cluster \(c_{\gamma}\) by \[c^{\gamma}=\left[p^{\mathrm{d}r_{1},\gamma}\quad p^{\mathrm{d}r_{2},\gamma}\quad \cdots\quad p^{\mathrm{d}r_{\Gamma},\gamma}\right] \tag{25}\]  
where \(\Gamma\) is the number of elements in \(c^{\gamma}\). Then, this cluster, and as such this driver group, is characterized by the centroid parameter of the cluster \(\gamma\), given in (26).  
\[p^{\gamma}=\frac{1}{\Gamma}\sum_{j=1}^{\Gamma}p^{\mathrm{d}r_{j},\gamma} \tag{26}\]  
Any driver given its parameter vector \(p^{\mathrm{d}r_{j}}\) can be classified into clusters \(c^{\gamma}\) by calculating the parameter error vector (27) to each centroid vector, and choosing the one it fits the most (28).  
\[\Delta p^{\mathrm{d}r_{j},\gamma}=p^{\mathrm{d}r_{j}}-p^{\gamma} \tag{27}\]  
\[\hat{c}^{\mathrm{d}r_{j}}=\mathrm{loc}(\min(\|\Delta p^{\mathrm{d}r_{j},\gamma }\|_{2})) \tag{28}\]