Advertisement

Understanding the K-means function involves learning its definition, how it works, and its applications.

阅读量:

X由两部分组成:一部分是使用 randn 生成的随机数加上 ones 向量的结果;另一部分是 randn 生成的随机数减去 ones 向量的结果。
通过上述构造方法生成了总共 100 个样本数据点。其中每一行代表一个具体的样本实例,在二维空间中体现为不同的坐标位置。
在配置统计选项时,默认设置已启用以显示最终结果;通过调用 statset 函数并指定 'Display' 参数为 'final' 来实现这一目标。

[idx,ctrs] = kmeans(X,2,'Distance','city','Replicates',5,'Options',opts);
%返回参数意义:[IDX,C,sumd,D]=kmeans()
IDX:每个样本点所在的类别
C:所聚类别的中心点坐标位置kp,k是所聚类别
sumd:每个类内各点到中心点的距离之和
D:每个点到各类中心点的距离n
k

Matlab聚类分析中kmeans函数运行结果,请教为什么?

k is set to 5;
[IDX, C, sumd, D] is returned by the k-means algorithm after processing the SCORE matrix's first three columns.
The SCORE matrix extracted from the

全部评论 (0)

还没有任何评论哟~