rasbt / pattern_classification

A collection of tutorials and examples for solving and understanding machine learning and pattern classification tasks
GNU General Public License v3.0
4.15k stars 1.29k forks source link

Problem with the Heatmap plus Row-dendrogram plot #41

Closed freko247 closed 9 years ago

freko247 commented 9 years ago

There's a problem with the Heatmap plus Row-dendrogram plot in the Hierarchical Agglomerative Clustering - Complete Linkage Clustering notebook. The dendrogram is actually up-side-down, I noticed this when I was using your example as a guide. My fix was to reverse the index of the data and the index labels, I could not find a clever way of reversing the dendrogram. Thanks for a great guide anyway. selection_002

rasbt commented 9 years ago

Thanks a lot for pointing this out. I think this can be accounted for by setting the count_sort order to 'descending' in the dendrogram or sort the DataFrame in reverse order using the dendrogram leave indices. I corrected the sections and added some explanations and a warning at the end to always check that the labels match before hiding the dendrogram labels, e.g.,

screen shot 2015-04-16 at 8 11 21 pm

Thanks, Sebastian