用Python中的scipy绘制树状图
scipy用Python中的scipy绘制树状图,python,numpy,scipy,Python,Numpy,Scipy,scipy树状图文档说明: dendrogram(Z, ...) The dendrogram illustrates how each cluster is composed by drawing a U-shaped link between a non-singleton cluster and its children. ...It is expected that the distances in Z[:,2] be monotonic, otherwi
树状图
文档说明:
dendrogram(Z, ...)
The dendrogram illustrates how each cluster is
composed by drawing a U-shaped link between a non-singleton
cluster and its children. ...It is expected that the distances in Z[:,2] be
monotonic, otherwise crossings appear in the dendrogram.
我不清楚“Z[:,2]中的距离应该是
单调,否则交叉出现在树状图中“?图中所指的交叉点是什么?有人能举一个例子说明为什么在特定的距离矩阵中会发生这种情况吗
这是一个十字路口的例子吗?在我看来,这只是由距离矩阵中的一些对称性引起的。。。
Z应该指定簇的合并(合并2个簇)及其发生的“时间”,其中“时间”是树状图的y轴(这是它们所指的距离)。Z的构造通常使“时间”以递增的顺序排列,这也使得绘图变得容易,从而使U形不相互重叠。如果你以不同的顺序绘制U,它们可能相互重叠,看起来会很混乱——这就是所谓的交叉点 我运行了一个简短的示例,这是一个交叉口的示例:
一句话:坚持正确的顺序。我不确定我是否仍然遵循。。我加了一个例子。这算是一个交叉点吗?@user248237dfsf我添加了一个示例。只要遵循手册的指导原则,您就会没事的。@user248237dfsf我不这么认为。看起来它只是在同一时间发生的。