could anyone help me how to change the number of clusters for every iteration

3 次查看(过去 30 天)
I am having an array of data set A=[1 2;
3 4;
5 6;
7 8;
9 10;
11 12]
I want to group A into different number of clusters under the condition the number of clusters should not be more than size(A,1)
I need to run for several iterations.
For every iteration the number of clusters needs to be changed.

采纳的回答

KSSV
KSSV 2019-2-18
A=[1 2;
3 4;
5 6;
7 8;
9 10;
11 12] ;
G = size(A,1) ;
idx = cell(G,1) ;
for i = 1:G
idx{i} = kmeans(A,i) ;
end
  5 个评论
jaah navi
jaah navi 2019-2-18
Those lines are meant for grouping the data set into clusters in a successive manner
first all are grouped into 1 cluster.
then 2 clusters,3 clusters ..................8 clusters.
But what i need is for one iteration the dataset needs to be grouped either in 1 or 2 or 3 or 4 or.......8.
for example if data set are grouped into 2 clusters during 1st iteration,it can be grouped into different number or same number of clusters in second iteration.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Cluster Analysis and Anomaly Detection 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by