Borrar filtros
Borrar filtros

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

3 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by