Clustering聚类
聚类是指通过无监督(unsupervised)技术对相似的数据对象进行分组形成簇。
K-means Clustering
给定m个对象的集合每个对象都有n个可测量的属性。
分四步:
- Choose the value of k, and the k initial guess for the centroids
选定 k 值,以及 k 个质心的初始猜测值。 - Compute the distance from each data point to each centroid. Assign each point to the closest centroid.
计算从每个数据点(xi ,yi )到每个质心的距离,然后每个点分配给最近的质心。所有分配
给同一个质心的点组成一个簇。一共形成 k 个簇,使用欧几里得距离来测量。
- Update the centroid of each cluster to become the center of gravity of the cluster.
算步骤 2 中新形成定义的每一个簇的质量中心,即新质心。
其中center of gravity是