# Classification of Tropical Cyclone Tracks in the Northwest Pacific Based on the SD-K-Means Model
## 2 Data and Methods
### Clustering Method
#### 2.3.4 SD-K-Means Clustering Algorithm  
TC track data are a typical time series. The DTW algorithm can be used to quantify the similarity between TC tracks, thereby realizing the clustering of TC tracks. However, some TCs may have singular points in their tracks or the appearance of circular tracks due to sudden changes in speed or direction, that is, there are situations where local changes are large. The DTW algorithm is less sensitive to such situations, which may affect the clustering effect, but Soft-DTW allows local inaccurate matching and is more robust to changes. At the same time, TC tracks belong to nonlinear time series of varying lengths. Compared with DTW, Soft-DTW is more suitable for clustering problems of such sequences. In addition, the Soft-DTW algorithm supports optimizing cluster centers by gradient descent, and the clustering effect can be optimized by adjusting the smoothing parameter \(\gamma\) introduced. In summary, this paper finally selected Soft-DTW to measure the similarity between TC tracks and proposed the SD-K-Means clustering model in combination with the K-Means clustering algorithm to cluster 507 TCs generated in the Northwest Pacific from 2000 to 2022. The main workflow of TC track clustering based on the proposed SD-K-Means clustering model is as follows:  
1. Compute the Soft-DTW distance matrix and the matrix of normalized TC features. The Soft-DTW clustering matrix and the TC feature information matrix are obtained based on the TC track data and the clustering index based on the quantification of TC feature variables, and they are combined as the input of the model. 2. Initialize cluster centers randomly. Assign each TC to the cluster with the nearest center using Soft-DTW. 3. Update the cluster center using the DBA algorithm. Since the Soft-DTW algorithm does not have the concept of explicit mean, the DBA algorithm is used to calculate the track mean as the new center track. Its alignment method is set to \"softdtw\", that is, the Soft-DTW algorithm is used to align the sequence, and then the above process is continuously iterated until the clustering result is stable. 4. To mitigate the randomness of center initialization, the clustering is repeated 1000 times. There are two commonly used methods for determining the optimal number of clustering categories \(K\): the Elbow Method and the Silhouette Coefficient Method. Among them, the Silhouette Coefficient Method comprehensively considers the compactness within the cluster and the separation between clusters and measures the clustering effect by calculating the silhouette coefficient. The specific calculation equation is shown in Equation (13). \[S_{i}=\frac{min(b_{i})-a_{i}}{max[a_{i},\ minb_{i}]} \tag{13}\]  
where \(S_{i}\) represents the silhouette coefficient score of the \(i\)-th sample, and its value range is \(-1-1\); \(a_{i}\) represents the average distance from the i-th sample to other samples of the same category; and \(b_{i}\) represents the average distance from the i-th sample to all samples outside the category. The closer the value of \(S_{i}\) is to 1, the better the clustering effect is. The closer the value of \(S_{i}\) is to 0, the worse the clustering effect is. The closer the value of \(S_{i}\) is to \(-1\), the more it means that the sample i is misclassified and should belong to other categories. The elbow rule measures the quality of clustering results under different \(K\) values by calculating the SSE of each cluster under different \(K\) values, that is, calculating the sum of squared distances between each sample and the cluster center of the cluster to which it belongs. The specific calculation equation is shown in Equation (10). The smaller the SSE value, the tighter the clustering result, that is, the better the clustering effect. However, in reality, as the \(K\) value continues to increase, the SSE value will continue to decrease.