splitting data based on cluster indices

2 ビュー (過去 30 日間)
George Leavitt
George Leavitt 2016 年 11 月 29 日
コメント済み: Walter Roberson 2016 年 11 月 29 日
Hello so I have customer data where I used kmeans clustering. It partitioned the data into 4 different clusters. If I have customer ids A = [1:1600] and the cluster indexes for each of theses 1600 customer ids. How can I separate the data so that I can view which customers are in each of the specific clusters.

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 11 月 29 日
results = cell(4,1);
for K = 1 : 4
results{K} = A( cluster_indices == K );
end
  2 件のコメント
George Leavitt
George Leavitt 2016 年 11 月 29 日
cluster indices would be IDK value from [IDK,C,sumd,D] = kmeans , so I should write results{K} = A(IDK == K}?
Walter Roberson
Walter Roberson 2016 年 11 月 29 日
Yes.

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

カテゴリ

Help Center および File ExchangeCluster Analysis and Anomaly Detection についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by