how can we know that which cluster has which data points after applying k-means clustering ?

2 ビュー (過去 30 日間)
satendra kumar
satendra kumar 2018 年 7 月 11 日
コメント済み: Image Analyst 2018 年 7 月 14 日
My data size is 100*11. I have applied k-means clustering and clusters are generated. I want to know about the data points of each cluster.Please give me solution of it.
Thanks in advance

回答 (2 件)

KSSV
KSSV 2018 年 7 月 11 日
kmean gives you classes of each cluster, from here it is easy to access the group/ class you want. Check the below code for demo:
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
  3 件のコメント
KSSV
KSSV 2018 年 7 月 14 日
It can be applied for any dimension....read the documentation...

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


Image Analyst
Image Analyst 2018 年 7 月 11 日
But the assigned class is exactly what kmeans gives you. Explain why you're confused about this.
Attached are some kmeans demos.
  1 件のコメント
satendra kumar
satendra kumar 2018 年 7 月 14 日
Hello sir thanks for your valuable time. but i want to show the data items of each cluster.

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

カテゴリ

Help Center および File ExchangeStatistics 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