correlation map sorted by hierarchy with dendrogram

8 vues (au cours des 30 derniers jours)
Oded Scharf
Oded Scharf le 30 Avr 2021
Modifié(e) : Oded Scharf le 2 Mai 2021
Hey.
I have a matrix of featurs X samples. I want to plot a correlation map between the features (features X features) that will be sorted by hierarchical clustering and I want the dendrogram to be ploted on the figure.
I have tried clustergram and cluster only on features but it creates a featurs X samples map sorted by features. How can I use this sorting for the correlation matrix?
I've also tried to to use linkage and sort the correlation matrix by optimalleaforder but then I don't know how to plot the dendrogram above the image, and I'm also not sure I'm doing it right.
this is the linkage way I tried:
tree = linkage(data,'single','correlation');
dist = 1-corr(data');
dist=round(dist,5);
leafOrder = optimalleaforder(tree,dist);
corr_map = corr(data');
figure, imagesc(corr_map(leafOrder,leafOrder)-eye(sum(num_features)))
What is the best way to do it?
Thanks for your help!
Oded

Réponses (0)

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by