K-means聚类算法(事先数据并没有类别之分!所有的数据都是一样的)
1、概述
K-means算法是集简单和经典于一身的基于距离的聚类算法
采用距离作为相似性的评价指标,即认为两个对象的距离越近,其相似度就越大。
[En]
Distance is used as the evaluation index of similarity, that is, the closer the distance between two objects is, the greater the similarity is.
该算法认为类簇是由距离靠近的对象组成的,因此把得到紧凑且独立的簇作为最终目标。
[En]
The algorithm believes that class clusters are composed of objects close to each other, so the ultimate goal is to get compact and independent clusters.
2、核心思想
通过迭代寻找k个类簇的一种划分方案,使得用这k个类簇的均值来代表相应各类样本时所得的总体误差最小。
k个聚类具有以下特点:各聚类本身尽可能的紧凑,而各聚类之间尽可能的分开。
k-means算法的基础是最小误差平方和准则,
其代价函数是: