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.

3 次查看(过去 30 天)
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.

回答(3 个)

Walter Roberson
Walter Roberson 2022-3-28
numclusters = 4;
Initial = numeric matrix that is numclusters x number of columns in YourData
[idx, C] = kmeans(YourData, numclusters, 'Start', initial);
  4 个评论
Sam Chak
Sam Chak 2022-3-29
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.

请先登录,再进行评论。


Sam Chak
Sam Chak 2022-3-29
Perhaps you can try the pdist2 method outlined in this link to find the centroids. Hope it helps.

Sam Chak
Sam Chak 2022-3-31
Have you successfully estimated the centroids and closed this issue?

类别

Help CenterFile Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by