Package igraph :: Module clustering :: Class VertexDendrogram
[hide private]
[frames] | no frames]

Class VertexDendrogram

  object --+        
           |        
  Clustering --+    
               |    
VertexClustering --+
                   |
  object --+       |
           |       |
  Clustering --+   |
               |   |
      Dendrogram --+
                   |
                  VertexDendrogram

The dendrogram resulting from the hierarchical clustering of the vertex set of a graph.

Instance Methods [hide private]
 
__init__(self, graph, merges, membership=None, modularity=None, params={})
Creates a dendrogram object for a given graph.
 
__plot__(self, context, bbox, palette, *args, **kwds)
Draws the vertex dendrogram on the given Cairo context
 
cut(self, n)
Cuts the dendrogram at a given level.

Inherited from VertexClustering: giant, recalculate_modularity, subgraph

Inherited from VertexClustering (private): _get_graph, _get_modularity

Inherited from Dendrogram: __str__, summary

Inherited from Clustering: __getitem__, __len__, size, size_histogram, sizes

Inherited from Clustering (private): _get_membership

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties [hide private]

Inherited from VertexClustering: graph, modularity, q

Inherited from Dendrogram: merges

Inherited from Clustering: membership

Inherited from object: __class__

Method Details [hide private]

__init__(self, graph, merges, membership=None, modularity=None, params={})
(Constructor)

 

Creates a dendrogram object for a given graph.

Parameters:
  • graph - the graph that will be associated to the clustering
  • merges - the merges performed given in matrix form.
  • membership - the membership list. The length of the list must be equal to the number of vertices in the graph. If None, the dendrogram will be cut at the level where the modularity is maximized and the membership list will represent this state.
  • modularity - the modularity score of the clustering on each level of the dendrogram starting from the fully decomposed state. If None, it will be calculated.
  • params - additional parameters to be stored in this object.
Overrides: object.__init__

__plot__(self, context, bbox, palette, *args, **kwds)

 

Draws the vertex dendrogram on the given Cairo context

See Dendrogram.__plot__ for the list of supported keyword arguments.

Overrides: Dendrogram.__plot__

cut(self, n)

 

Cuts the dendrogram at a given level.

Parameters:
  • n - the desired number of clusters. Merges are replayed from the beginning until the membership vector has exactly n distinct elements or until there are no more recorded merges, whichever happens first.
Returns:
the membership vector