フィルターのクリア

Getting the data points of each cluster in kmeans.

7 ビュー (過去 30 日間)
HIRAKJYOTI BASUMATARY
HIRAKJYOTI BASUMATARY 2017 年 10 月 18 日
コメント済み: shahab anjum 2020 年 3 月 4 日
After i perform kmeans algorithm of matlab , i get the number of the desired clusters. Now if i want to see the data points of each cluster , how will i proceed. Is there any command in matlab that would help me get that. Any suggestions would be really helpful. Thank You

採用された回答

KSSV
KSSV 2017 年 10 月 18 日
編集済み: KSSV 2017 年 10 月 18 日
K = 4 ; % groups
N = 5000 ;
x = rand(N,1) ;
y = rand(N,1) ;
% apply kmeans
idx = kmeans([x,y],K) ;
% get each cluster
data = cell(K,1) ;
figure
hold on
for i = 1:K
data{i} = [x(idx==i),y(idx==i)] ;
plot(x(idx==i),y(idx==i),'.')
end
  18 件のコメント
Image Analyst
Image Analyst 2019 年 3 月 29 日
Since we can't even visualize 275 dimensions, why do you think you have 6 centroids? What leads you to that conclusion/guess? Do you have any screenshots to explain that?
MA-Winlab
MA-Winlab 2019 年 4 月 1 日
I am assuming 6 clusters. But I am working on testing with different k number and then compute sillhouette score to see which number to pick.

サインインしてコメントする。

その他の回答 (1 件)

shahab anjum
shahab anjum 2020 年 3 月 2 日
did we got the data as matrix form as before..? After the kmeans apply. can u help plz
  4 件のコメント
shahab anjum
shahab anjum 2020 年 3 月 4 日
dear mr MA-Winlab
i have 1000x286 matrix after kmeans i got 1000x286 matrix of clustered data in the form of 1 and 2. i want to get the data back for next work in the shape of 2D matrix 1000x286 same as clustered matrix of kmeans but when i use the above code its gives the data back but not in 2D matrix form but in matrix form with 2 cells. please help me out
shahab anjum
shahab anjum 2020 年 3 月 4 日
dear Mr. Walter can u please explain it easy way i really so confused please

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by