hierarchical-clustering

How to cluster a graph using python igraph

时光毁灭记忆、已成空白 提交于 2020-02-02 13:33:47
问题 I've been using python igraph to try to make an easier time of generating and analyzing graphs. My code below generates a random graph of 50 nodes and clusters it: from igraph import * import random as rn g = Graph() size = 50 g.add_vertices(size) vert = [] for i in range(size): for j in range(size): test = rn.randint(0,5) if j >= i or test is not 0: continue g.add_edges([(i,j)]) #layout = g.layout("kk") #plot(g, layout = layout) #dend = VertexDendrogram(graph=g, optimal_count=10) clust =

How to cluster a graph using python igraph

≡放荡痞女 提交于 2020-02-02 13:29:46
问题 I've been using python igraph to try to make an easier time of generating and analyzing graphs. My code below generates a random graph of 50 nodes and clusters it: from igraph import * import random as rn g = Graph() size = 50 g.add_vertices(size) vert = [] for i in range(size): for j in range(size): test = rn.randint(0,5) if j >= i or test is not 0: continue g.add_edges([(i,j)]) #layout = g.layout("kk") #plot(g, layout = layout) #dend = VertexDendrogram(graph=g, optimal_count=10) clust =

Generating a heatmap that depicts the clusters in a dataset using hierarchical clustering in R

ε祈祈猫儿з 提交于 2020-01-28 05:01:11
问题 I am trying to take my dataset which is made up of protein dna interaction, cluster the data and generate a heatmap that displays the resulting data such that the data looks clustered with the clusters lining up on the diagonal. I am able to cluster the data and generate a dendrogram of that data however when I generate the heatmap of the data using the heatmap function in R, the clusters are not visible. If you look at the first 2 images one is of the dendrogram I am able to generate, the

Generating a heatmap that depicts the clusters in a dataset using hierarchical clustering in R

别等时光非礼了梦想. 提交于 2020-01-28 05:01:05
问题 I am trying to take my dataset which is made up of protein dna interaction, cluster the data and generate a heatmap that displays the resulting data such that the data looks clustered with the clusters lining up on the diagonal. I am able to cluster the data and generate a dendrogram of that data however when I generate the heatmap of the data using the heatmap function in R, the clusters are not visible. If you look at the first 2 images one is of the dendrogram I am able to generate, the

Deconflicting markers in map overlays

若如初见. 提交于 2020-01-23 13:02:35
问题 I need to solve the problem of marking thousands of items on a map in a way that's accurate and readable and fast even when the user zooms out so that markers would overlap in confusing ways. It's an Android MapView , but my questions are more general. I am aware of Fluster, grid-based schemes, and various heuristics. These algorithms appear to be inaccurate in that cluster markers don't correspond to the centroid. My application is safety critical, and the markers are fairly big, so

Deconflicting markers in map overlays

拜拜、爱过 提交于 2020-01-23 13:02:24
问题 I need to solve the problem of marking thousands of items on a map in a way that's accurate and readable and fast even when the user zooms out so that markers would overlap in confusing ways. It's an Android MapView , but my questions are more general. I am aware of Fluster, grid-based schemes, and various heuristics. These algorithms appear to be inaccurate in that cluster markers don't correspond to the centroid. My application is safety critical, and the markers are fairly big, so

Color branches of dendrogram using an existing column

柔情痞子 提交于 2020-01-21 08:55:17
问题 I have a data frame which I am trying to cluster. I am using hclust right now. In my data frame, there is a FLAG column which I would like to color the dendrogram by. By the resulting picture, I am trying to figure out similarities among various FLAG categories. My data frame looks something like this: FLAG ColA ColB ColC ColD I am clustering on colA , colB , colC and colD . I would like to cluster these and color them according to FLAG categories. Ex - color red if 1, blue if 0 (I have only

Color branches of dendrogram using an existing column

筅森魡賤 提交于 2020-01-21 08:52:27
问题 I have a data frame which I am trying to cluster. I am using hclust right now. In my data frame, there is a FLAG column which I would like to color the dendrogram by. By the resulting picture, I am trying to figure out similarities among various FLAG categories. My data frame looks something like this: FLAG ColA ColB ColC ColD I am clustering on colA , colB , colC and colD . I would like to cluster these and color them according to FLAG categories. Ex - color red if 1, blue if 0 (I have only

Hierarchical Clustering Large Sparse Distance Matrix R

我只是一个虾纸丫 提交于 2020-01-04 07:56:40
问题 I am attempting to perform fastclust on a very large set of distances, but running into a problem. I have a very large csv file (about 91 million rows so a for loop takes too long in R) of similarities between keywords (about 50,000 unique keywords) that when I read into a data.frame looks like: > df kwd1 kwd2 similarity a b 1 b a 1 c a 2 a c 2 It is a sparse list and I can convert it into a sparse matrix using sparseMatrix(): > myMatrix a b c a . . . b 1 . . c 2 . . However, when I attempt

Interpreting the output of SciPy's hierarchical clustering dendrogram? (maybe found a bug…)

泄露秘密 提交于 2020-01-02 07:11:49
问题 I am trying to figure out how the output of scipy.cluster.hierarchy.dendrogram works... I thought I knew how it worked and I was able to use the output to reconstruct the dendrogram but it seems as if I am not understanding it anymore or there is a bug in Python 3 's version of this module. This answer, how do I get the subtrees of dendrogram made by scipy.cluster.hierarchy, implies that the dendrogram output dictionary gives dict_keys(['icoord', 'ivl', 'color_list', 'leaves', 'dcoord']) w/