k-means是一种非监督 (从下图 0 当中我们可以看到训练数据并没有标签标注类别)的聚类算法:

K-Means clustering intends to partition n objects into k clusters in which each object belongs to the cluster with the nearest mean. This method produces exactly k different clusters of greatest possible distinction. The best number of clusters k leading to the greatest separation (distance) is not known as a priori and must be computed from the data. The objective of K-Means clustering is to minimize total intra-cluster variance, or, the squared error function: 

 

k-means 聚类过程演示

0.initial

k-means 聚类过程演示

 

1.select centroids randomly   

 k-means 聚类过程演示 

 

2.assign points

 k-means 聚类过程演示

 3.update centroids

k-means 聚类过程演示

 4.reassign points

k-means 聚类过程演示

 5.update centroids

k-means 聚类过程演示

 

 6.reassign points

k-means 聚类过程演示

 

7.iteration

 

reference:

https://www.naftaliharris.com/blog/visualizing-k-means-clustering/

https://www.saedsayad.com/clustering_kmeans.htm

转载请注明来源:https://www.cnblogs.com/lnas01/p/10347650.html

 

相关文章:

  • 2021-09-01
  • 2022-12-23
  • 2023-01-30
  • 2022-12-23
  • 2022-02-07
  • 2021-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-18
  • 2021-12-13
  • 2021-09-29
  • 2021-04-12
  • 2021-06-24
相关资源
相似解决方案