0

The scipy dendrogram documentation says:

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.

I'm unclear about the sentence about "It is expected that the distances in Z[:,2] be monotonic, otherwise crossings appear in the dendrogram"? What crossing in the diagram is referred to? Can someone please show an example where this happens for a particular distance matrix with an explanation of why?

Is this an example of a crossing? seems to me this arises just by some symmetries in distance matrix... enter image description here

1 Answer 1

1

Z is supposed to specify merges of clusters (which 2 clusters are merged) and the "time" they happen, where "time" is the y-axis of the dendrogram (this is what they mean by distances). Z is usually constructed so that "time" is in increasing order, which also makes it easy to plot so that U shapes are not on top of each other. If you plot the U's in a different order, they may overlap each other and it will looked messed up - that is what is referred to as crossings.

I ran a short example, this is an example of what a crossing will look like:

enter image description here

Bottom line: stick with the correct order.

Sign up to request clarification or add additional context in comments.

3 Comments

not sure I follow still.. I added an example. Is that considered a crossing?
@user248237dfsf I added an example. Just follow the manual guidelines and you will be fine.
@user248237dfsf I don't think so. Looks like it just happens at the same "time".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.