在 MATLAB 中查询 k-means 聚类 [英] Query regarding k-means clustering in MATLAB

查看:43
本文介绍了在 MATLAB 中查询 k-means 聚类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有大量矩阵形式的数据.我已经在 MATLAB R2013a 中使用 k 均值聚类对其进行了聚类.我想要形成的每个簇的质心的确切坐标..是否可以使用任何公式或其他任何东西?

I have a very large amount of data in the form of matrix.I have already clustered it using k-means clustering in MATLAB R2013a. I want the exact coordinates of the centroid of each cluster formed.. Is it possible using any formula or anything else?

我想找出每个簇的质心,这样每当有新数据到达矩阵时,我就可以计算它与每个质心的距离,从而找出新数据所属的簇

I want to find out the centroid of each cluster so that whenever some new data arrives in matrix, i can compute its distance from each centroid so as to find out the cluster to which new data will belong

我的数据本质上是异构的.所以,很难找出每个集群的数据的平均值.所以,我正在尝试编写一些代码来自动打印质心位置.

My data is heterogeneous in nature.So,its difficult to find out average of data of each cluster.So, i am trying to write some code for printing the centroid location automatically.

推荐答案

在 MATLAB 中,使用

In MATLAB, use

[idx,C] = kmeans(..) 

代替

idx = kmeans(..) 

根据文档:

[idx,C] = kmeans(..) 返回 k×p 矩阵 C 中的 k 个簇质心位置.

[idx,C] = kmeans(..) returns the k cluster centroid locations in the k-by-p matrix C.

这篇关于在 MATLAB 中查询 k-means 聚类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆