0
我想绘制使用Python的树状图,最好使用Plotly。我有一个数据集包含各种对象的聚类。我可以使用此数据集来生成所需的数据或至少外插。但是,我不明白create_dendrogram的输入实际上是什么。该文档只是说它是一个ndarray - 作为数组阵列的观察矩阵。我对Numpy ndarrays很熟悉,但我想知道数组必须包含什么。使用Plotly Python绘制树状图
更具体地说,值X [i] [j]的意义是什么。它只是似乎是0和1之间。我已经在为Python这里Plotly API文档看起来浮 -
import plotly.plotly as py
from plotly.tools import FigureFactory as FF
import numpy as np
X = np.random.rand(10, 10)
fig = FF.create_dendrogram(X, orientation='left', labels=names)
py.iplot(fig, filename='dendrogram_with_labels')
如果有另一种更直观的方式在Python得到一个树状我会也喜欢知道。我对此感到陌生,任何帮助将不胜感激。 (请让我知道如果我需要重新提出这个问题!)
看看http://docs.scipy.org/doc/scipy/reference/generated/scipy.cluster.hierarchy.dendrogram.html –
感谢沃伦,但在SciPy的使用ndarray .cluster.hierarchy.dendrogram使用4乘(n-1)矩阵(ndarray),而对于Plotly,它是焦虑状态。 –
有一种方法可以使用ggplot2 + dendextend + plot来做到这一点 –