Questions tagged [dendrogram]

A dendrogram (or tree diagram) is a graph used to represent relationships in hierarchical clustering.

Tag usage

Questions on tag should be about implementation and programming problems, not about the statistical or theoretical properties of the technique.
Consider whether your question might be better suited to Cross Validated, the StackExchange site for statistics, machine learning and data analysis.

586 questions
4
votes
2 answers

retrieve leave colors from scipy dendrogram

I can not get the color leaves from the scipy dendrogram dictionary. As stated in the documentation and in this github issue, the color_list key in the dendrogram dictionary refers to the links, not the leaves. It would be nice to have another key…
4
votes
2 answers

How can we put label of hclust in table according to clusters formed in dendogram

I have a dendogram with clusters having many leaf nodes/labels How can I put these labels of hclust in a table row wise according to the clusters formed using R
New_to_ML
  • 73
  • 4
4
votes
2 answers

How to extract the labels under some node with height in dendrogram?

I have a dendrogram and I would like to extract all the lables under a node that I already know its height. For example: data = data.frame(point = c('A','B','C','D','E'), x = c(2,2.5,2.1,3,5), y =…
4
votes
0 answers

How do I work with data once it has been clustered?

I've clustered some stocks based on the ward algo and now I want to take the clusters and pair up the stocks inside each cluster I've found ways to write a dictionary containing all the stocks and what color of the dendrogram they are associated…
4
votes
1 answer

How to label colored bars in a dendrogram

How could I add a label for some colored bars I've added in a dendrogram plot? The code bellow will show the two attempts I've done for aiming task, which is linking the value 1 to the color red and value 0 to color white in a label for the colored…
Gilgamesh
  • 589
  • 1
  • 6
  • 20
4
votes
2 answers

R cluster analysis and dendrogram with correlation matrix

I have to perform a cluster analysis on a big amount of data. Since I have a lot of missing values I made a correlation matrix. corloads = cor(df1[,2:185], use = "pairwise.complete.obs") Now I have problems how to go on. I read a lot of articles…
Essi
  • 761
  • 3
  • 12
  • 22
4
votes
1 answer

Cutting SciPy hierarchical dendrogram into clusters on multiple threshold values

I would like to cut my SciPy's dendrogram into a number of clusters on multiple threshold values. I've tried using fcluster but it can cut only on one threshold value. (Here is a piece of code which I have taken from another question for…
mux032
  • 65
  • 2
  • 8
4
votes
1 answer

Increase space between leaves and labels in ggplot2 dendrogram

I need to plot clustering dendrogram using ggplot2. To create dendrogram object I use as.ggdend() function from the dendextend package. However, the space between leaves and labels is very small (see the figure below). Any idea how to increase…
Andrej
  • 3,719
  • 11
  • 44
  • 73
4
votes
1 answer

Combining a heatmap and a dendrogram in a grob plot

I'm trying to plot a heatmap along with a row dendrogram, which I manipulated (pruned the number of branches), aligned using grid.draw. Here's my data: set.seed(10) mat <-…
dan
  • 6,048
  • 10
  • 57
  • 125
4
votes
1 answer

making plotly dendrogram in javascript

Want to make https://plot.ly/python/dendrogram/ with plotly.js. Is it possible? Has anyone implemented dendrogram in javascript?
mei
  • 67
  • 9
4
votes
3 answers

Adding a Dendrogram to a ggplot2 Heatmap

New R user here. I am trying to add a dendrogram to this heatmap that I created using ggplot2. How can I do that? I have added my code to the heat map below. #Mtcars using ggplots and reshape2…
Charlotte
  • 41
  • 1
  • 1
  • 4
4
votes
2 answers

Cutting Dendrogram/Clustering Tree from SciPy at distance height

I'm trying to learn how to use dendrograms in Python using SciPy . I want to get clusters and be able to visualize them; I heard hierarchical clustering and dendrograms are the best way. How can I "cut" the tree at a specific distance? In this…
O.rka
  • 29,847
  • 68
  • 194
  • 309
4
votes
2 answers

How to change node labels of dendrogram plot

I did a hierarchical cluster for a project. I have 300 observations each of 20 variables. I indexed all the variables so that each variable is between 0 and 1, a larger value being better. I used the following code to create a cluster plot. d_data…
4
votes
1 answer

How does R heatmap order rows by default?

The R heatmap() documentation says for Rowv and Colv (i.e. row and column ordering parameters): If either is missing, as by default, then the ordering of the corresponding dendrogram is by the mean value of the rows/columns, i.e., in the case of…
jrx1301
  • 163
  • 2
  • 8
4
votes
2 answers

Annotating Dendrogram nodes in Scipy/Matplotlib

I'm trying to label the nodes in a dendrogram produced by scipy.cluster.hierarchy.dendrogram. I'm working with the augmented dendrogram suggested here, trying to replace the inter-cluster distance labels (1.01,1.57) in the example by strings such…
user666
  • 5,231
  • 2
  • 26
  • 35