def process(self, obj_data):
'''
Produces a cluster map and stores the linkage results.
@param obj_data: Data wrapper
'''
import seaborn as sns
data = obj_data.getResults()[self.obj_name]
linkage = sp.cluster.hierarchy.linkage(data, method='average')
plt.figure()
g = sns.clustermap(data, col_linkage = linkage, row_linkage=linkage)
for item in g.ax_heatmap.get_yticklabels():
item.set_rotation(0)
plt.figure()
sp.cluster.hierarchy.dendrogram(linkage)
obj_data.addResult(self.str_description, linkage)
评论列表
文章目录