K均值 && 模糊c均值

matlab帮助--统计工具箱--Multivariate Statistics--clusteranalysis,里面是实例,K-mean和c-mean是一回事
在help-search中搜  fuzzy cluster,就有相应函数了,fcm

clusterT= kmeans(mm',clusternum);%mm' 为样本按行排列,clusternum聚类总数
cluster=find(clusterT==i);%找到每个聚类中具体样本的位置
%i=1.....clusternum

下面是函数使用说明
kmeans K-means clustering SyntaxIDX = kmeans(X,k)
[IDX,C] = kmeans(X,k)
[IDX,C,sumd] = kmeans(X,k)
[IDX,C,sumd,D] = kmeans(X,k)
[...] = kmeans(...,'param1',val1,'param2',val2,...)
DescriptionIDX = kmeans(X, k) partitions the points in the n-by-p data matrix X into k clusters. This iterative partitioning minimizes the sum, over all clusters, of the within-cluster sums of point-to-cluster-centroid distances. Rows of X correspond to points, columns correspond to variables. kmeans returns an n-by-1 vector IDX containing the cluster indices of each point. By default, kmeans uses squared Euclidean distances.

 

 

模糊C-均值聚类的函数是fcm,

fcm函数是一个反复迭代运算,并建立在initfcm函数(处始化)、distfcm函数(距离计

算)和stepfcm函数(迭代步数)上的函数。 函数如下:

[CENTER, U, OBJ_FCN] = FCM(DATA, N_CLUSTER)

中文帮助说明如下:

CENTER:聚类中心

U:每一个数据点的隶属等级

OBJ_FCN:迭代更新的历史

DATA:原始的数据

N_CLUSTER:分类数目

你可能感兴趣的:(K均值 && 模糊c均值)