Borrar filtros
Borrar filtros

Kmeans clustering in k=10

2 visualizaciones (últimos 30 días)
Ali Ali
Ali Ali el 18 de Abr. de 2018
Comentada: Ali Ali el 21 de Abr. de 2018
I have a matrix with (256*1707) and I want to cluster it with Kmeans with k=10, and plot it..?
I appreciate any help you can provide.

Respuestas (1)

njj1
njj1 el 18 de Abr. de 2018
Editada: njj1 el 18 de Abr. de 2018

1) Randomly initialize 10 cluster centroids. This can be done by simply randomly selecting 10 points from your dataset.

2) Compute the distance (Euclidean, presumably) from each data point to these 10 centroids.

3) Assign cluster membership of each point to the cluster who's centroid is the closest.

4) Re-compute centroid of each cluster

5) Compute distance from each data point to the 10 centroids.

6) So on...

Plotting:

for i=1:10
     plot(matrix(cluster==i,dim1),matrix(cluster==i,dim2),'o')
     hold on
end

In this plot, you have to choose two dimensions to plot against each other. From the looks of it, you have either 256 or 1707 dimensions (aka features).

  17 comentarios
Image Analyst
Image Analyst el 19 de Abr. de 2018
Ali, attach your data in a .mat file if you want more help, to make it easier for people to help you.
Also, you've marked it solved/accepted, so are you all done with this question?
Ali Ali
Ali Ali el 21 de Abr. de 2018
Hi,
this is my input.

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by