【发布时间】:2018-07-16 19:15:40
【问题描述】:
我正在尝试使用 cluster heatmap function in Seaborn.
问题在于这两个数据集来自两个不同的过程,因此它们包含不同分布的值(我的意思是,第一个数据集的值范围从 0 到 1,但第二个数据集从 1000 到 5000 )。
我的问题是:
如何对具有不同值范围的两个数据集进行聚类?有没有办法将数据集的行聚集成一个热图,并且每个数据集可能有两个比例?
这是我迄今为止尝试过的,但收效甚微:
#First, I have combined the two datasets into one dataframe object:
dataset = pd.concat([dataset_1, dataset_2], axis=0)
#Then, passed the dataframe into Seaborn's `.clustermap()` function:
sns.clustermap(data=dataset,
col_cluster=False)
输出:你可以注意到dataset_1的特征都被屏蔽掉了,因为数据集之间的规模差异(dataset_1和dataset_2如下图所示)
知道如何解决这个问题吗?
【问题讨论】:
标签: python matplotlib heatmap seaborn hierarchical-clustering