Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
jaah navi
jaah navi le 18 Fév 2019
Commenté : jaah navi le 18 Fév 2019
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.

Réponse acceptée

KSSV
KSSV le 18 Fév 2019
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 commentaires
KSSV
KSSV le 18 Fév 2019
What do you think these lines do?
for i = 1:G
idx{i} = kmeans(A,i) ;
end
jaah navi
jaah navi le 18 Fév 2019
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.

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by