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 CenterFile Exchange에서 Cluster 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