フィルターのクリア

Finding labels of a linkage.

1 回表示 (過去 30 日間)
BHAGYALAKSHMI M
BHAGYALAKSHMI M 2020 年 3 月 9 日
回答済み: Ameer Hamza 2020 年 3 月 9 日
How can I find the labels of the linkage clustering? Anybody, Please help me.

回答 (1 件)

Ameer Hamza
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.

Community Treasure Hunt

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

Start Hunting!

Translated by