# A Vehicle Velocity Prediction Method with Kinematic Segment Recognition
## 2 Data Preprocessing
### Kinematic Fragment Clustering  
The establishment of the neural network vehicle velocity prediction sub model needs to obtain samples for different driving conditions. Therefore, the collected kinematic fragments need to be classified after the characteristic parameters of 317 kinematic fragments are reduced from ten dimensions to three dimensions. Unlike general classification, kinematic segments have multi-dimensional characteristics, and the classification criteria cannot be determined in advance. Therefore, the clustering method is applicable here. The clustering algorithm will automatically classify the categories based on the features of the input samples and cluster the kinematic fragments with similar features together. Commonly used clustering methods include the partitioning method, hierarchical method, density-based method, grid-based method, and model-based method. In this paper, the K-means algorithm was used to cluster the kinematic fragment samples. The process of the K-means algorithm is as follows [29]:  
Input: number of \(k\) clusters; D: dataset containing \(k\) objects. Output: set and class number of \(k\) clusters. 1. According to the randomness principle, the algorithm selects \(k\) objects from the dataset as the center of \(k\) clusters, which is called the initial cluster center. 2. Calculate the distance of all other objects to the initial cluster center, classify all objects into this k cluster with the shortest principle of European distance, and obtain the k initial clustering. Distance is used to characterize the similarity between objects, describing the real distance of two objects in space, and the calculation formula is: \[d\big{(}X_{i},X_{j}\big{)}=\sqrt{\sum_{k=1}^{\frac{n}{2}}\big{(}X_{ik},X_{jk} \big{)}^{2}}\] (21)
3. Mobile clustering center, where the average value of the data objects in each initial cluster is calculated, and the centroid of each cluster is obtained as the new cluster center. 4. The distance of all data objects to the new cluster center is calculated, and the data objects are reclassified according to the principle of minimum distance. Repeat the \begin{table}
\begin{tabular}{c c c} \hline \hline
**Sample** & \(\mathbf{f_{1}}\) & \(\mathbf{f_{2}}\) & \(\mathbf{f_{3}}\) \\ \hline
1 & \(-\)3.1689 & \(-\)1.2193 & 0.8208 \\
2 & \(-\)3.164 & \(-\)1.2196 & 0.8176 \\
3 & \(-\)3.1628 & \(-\)1.2197 & 0.8161 \\
4 & \(-\)3.1605 & \(-\)1.2198 & 0.8144 \\
5 & \(-\)3.159 & \(-\)1.2195 & 0.8138 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Score data for the three principal components. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Normalized** & **Eigenvector** & **Eigenvector** & **Eigenvector** \\
**Variable** & **Type 1** & **Type 2** & **Type 3** \\ \hline \(v_{\text{true}}\) & 0.4367 & \(-\)0.0049 & 0.2382 \\ \(v_{\text{max}}\) & 0.4429 & 0.0262 & 0.2279 \\ \(\sigma\) & 0.4423 & 0.0423 & 0.0872 \\ \(\eta_{a}\) & \(-\)0.0909 & 0.5  
above steps; the algorithm ends when the optimal \(E\) value of the objective function is minimum and no longer changes. The calculation formula of the cluster center is as follows:  
\[\xi_{k}=\frac{1}{n_{k}}\sum_{x_{i}\in\xi_{k}}x_{i} \tag{22}\]  
The optimal E value of the objective function is calculated as follows:  
\[E=\sum_{i=1}^{k}\sum_{j=1}^{n_{j}}d\big{(}X_{i},X_{j}\big{)} \tag{23}\]  
where, \(\xi_{k}\) is the cluster center (\(k=1,2,3\)). Table 5 shows the cluster center after classification. By classifying the three-dimensional principal component information of the samples, the amount of pre-classification of the K-means algorithm was determined to be three categories. The cluster corresponding to the first cluster center \(\xi_{1}\) represents driving condition type 3 with a long driving distance, high average velocity, and maximum velocity.