I want to make 4 clusters using k mean clustering and for each of the 4 clusters i want to set centroid initially and then accordingly make the cluster. how can I.
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
I want to make 4 clusters using k mean clustering and for each of the 4 clusters i want to set centroid initially and then accordingly make the cluster. how can I.
0 comentarios
Respuestas (3)
Walter Roberson
el 28 de Mzo. de 2022
numclusters = 4;
Initial = numeric matrix that is numclusters x number of columns in YourData
[idx, C] = kmeans(YourData, numclusters, 'Start', initial);
4 comentarios
Sam Chak
el 29 de Mzo. de 2022
Guess @Maimoona Asad wants to 'estimate' 4 centroids for the given set of data, probably because she does not have a clear idea how many clusters there should be.
The centroid estimations are intended to indicate the mean locations of the clusters, even though this initial guess for the cluster centers may be inaccurate.
With the initial cluster centers, then she can apply the k-means clustering technique as you suggested.
Walter Roberson
el 29 de Mzo. de 2022
The 'Start' option has several possibilities to estimate cluster centers in different ways; https://www.mathworks.com/help/stats/kmeans.html#buefs04-Start
Sam Chak
el 29 de Mzo. de 2022
Perhaps you can try the pdist2 method outlined in this link to find the centroids. Hope it helps.
0 comentarios
Sam Chak
el 31 de Mzo. de 2022
Have you successfully estimated the centroids and closed this issue?
0 comentarios
Ver también
Categorías
Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!