Finding labels of a linkage.

1 Ansicht (letzte 30 Tage)
BHAGYALAKSHMI M
BHAGYALAKSHMI M am 9 Mär. 2020
Beantwortet: Ameer Hamza am 9 Mär. 2020
How can I find the labels of the linkage clustering? Anybody, Please help me.

Antworten (1)

Ameer Hamza
Ameer Hamza am 9 Mär. 2020
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.

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