Finding labels of a linkage.
조회 수: 1 (최근 30일)
이전 댓글 표시
How can I find the labels of the linkage clustering? Anybody, Please help me.
댓글 수: 0
답변 (1개)
Ameer Hamza
2020년 3월 9일
Similar to your other question, I used the same dataset to show how to determine the cluster labels
You need to use the function cluster to extract the cluster number of each data point. For example,
data=readtable('Liverxl.xlsx', 'ReadVariableNames', false);
data.Var2 = findgroups(data.Var2); % convert column
data.Var10(isnan(data.Var10)) = 0; % place 0 in empty cells
data = table2array(data);
maximum_num_clusters = 5;
Z = linkage(data, 'average');
cluster_labels = cluster(Z, 'Maxclust', maximum_num_clusters);
clusters = splitapply(@(x) {x}, data, cluster_labels);
Again here, clusters is a cell array.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!