怎样用matlab实现多维K-means聚类算法
发布网友
发布时间:2022-04-27 07:11
我来回答
共2个回答
热心网友
时间:2022-06-19 22:06
直接用kmeans函数。。。
idx = kmeans(X,k)
idx = kmeans(X,k,Name,Value)
[idx,C] = kmeans(___)
[idx,C,sumd] = kmeans(___)
[idx,C,sumd,D] = kmeans(___)
idx = kmeans(X,k) performs k-means clustering to partition the observations of the n-by-p data matrix X into k clusters, and returns an n-by-1 vector (idx) containing cluster indices of each observation. Rows of X correspond to points and columns correspond to variables.
By default, kmeans uses the squared Euclidean distance measure and the k-means++ algorithm for cluster center initialization.
example
idx = kmeans(X,k,Name,Value) returns the cluster indices with additional options specified by one or more Name,Value pair arguments.
For example, specify the cosine distance, the number of times to repeat the clustering using new initial values, or to use parallel computing.
example
[idx,C] = kmeans(___) returns the k cluster centroid locations in the k-by-p matrix C.
example
[idx,C,sumd] = kmeans(___) returns the within-cluster sums of point-to-centroid distances in the k-by-1 vector sumd.
example
[idx,C,sumd,D] = kmeans(___) returns distances from each point to every centroid in the n-by-k matrix D.
热心网友
时间:2022-06-19 22:07
这个貌似demo里面有