4.0
Other
K-means clustering method is divided into the following steps:
First, initializing cluster centers
1, depending on the issue, experience from samples selected in the sample set c is appropriate as the initial cluster centers.
2, with ex-c samples as the initial cluster centers.
3, all samples were randomly divided into class c, calculate the sample mean for each class, the sample mean as the initial cluster centers.
Second, the initial clustering
1, according to principle samples into the nearest cluster centers represent the class.
2, take a sample, classify it and its nearest cluster centers in that category, recalculate the sample mean, updating cluster centers. Then remove a sample, repeat the operation until all the samples into the corresponding classes in the.
Three reasonable, to determine whether clustering
Code of error sum of squares function to determin
matlab
算法
程序
均值
No comment