Research Article

Research on the Application of Animation Design Based on Machine Learning and Dynamic Image Index

Table 4

Improved K-Means algorithm.

InputUser input data set s for clustering and T maximum number of iterations
OutputClustering of K clusters.

1Scan the original data set to find the two data points with the largest distance as the initial clustering center C, and the K is 2.
2Referring to the maximum and minimum clustering method, the distance from each point to each cluster center in the data set is viewed, and the shortest distance is taken and recorded.
3The shortest distance from each point to each type of center is compared, and the data point with the maximum distance is taken as the candidate of the new cluster center. At this time, the previous cluster center should be saved to find that the cluster center candidate is not suitable and goes back to the previous result. The result of the new cluster center should be reclustered, the cluster center should be updated, and the value DBI the objective function should be updated for the K+ cluster.
4According to the previous analysis, it is judged whether the new K value can be the result of clustering to reach the optimal solution. As the DBI calculation results become smaller than the last time, it is proved that the new cluster center point is better; we should go back to the second step and continue to iterate. If the result is larger than the last time, the last K value should be optimal; return to the last cluster center, and jump to step 5.
5The result of the optimal K is obtained, and the clustering result satisfies the optimal solution of the objective function and returns K cluster result clusters.