splitting data based on cluster indices

1 Ansicht (letzte 30 Tage)
George Leavitt
George Leavitt am 29 Nov. 2016
Kommentiert: Walter Roberson am 29 Nov. 2016
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.

Antworten (1)

Walter Roberson
Walter Roberson am 29 Nov. 2016
results = cell(4,1);
for K = 1 : 4
results{K} = A( cluster_indices == K );
end
  2 Kommentare
George Leavitt
George Leavitt am 29 Nov. 2016
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 am 29 Nov. 2016
Yes.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by