python-igraph API reference

List of all classes, functions and methods in python-igraph

class documentation

class VertexDendrogram(Dendrogram):

View In Hierarchy

The dendrogram resulting from the hierarchical clustering of the vertex set of a graph.
Method __init__ Creates a dendrogram object for a given graph.
Method __plot__ Draws the vertex dendrogram on the given Cairo context or matplotlib Axes
Method as​_clustering Cuts the dendrogram at the given level and returns a corresponding VertexClustering object.
Method optimal​_count​.setter Undocumented
Property optimal​_count Returns the optimal number of clusters for this dendrogram.
Instance Variable _graph Undocumented
Instance Variable _modularity​_params Undocumented
Instance Variable _names Undocumented
Instance Variable _optimal​_count Undocumented

Inherited from Dendrogram:

Method __str__ Undocumented
Method format Formats the dendrogram in a foreign format.
Method names​.setter Sets the names of the nodes in the dendrogram
Method summary Returns the summary of the dendrogram.
Property merges Returns the performed merges in matrix format
Property names Returns the names of the nodes in the dendrogram
Static Method _convert​_matrix​_to​_tuple​_repr Converts the matrix representation of a clustering to a tuple representation.
Method _traverse​_inorder Conducts an inorder traversal of the merge tree.
Instance Variable _merges Undocumented
Instance Variable _nitems Undocumented
Instance Variable _nmerges Undocumented
def __init__(self, graph, merges, optimal_count=None, params=None, modularity_params=None):
Creates a dendrogram object for a given graph.
Parameters
graphthe graph that will be associated to the clustering
mergesthe merges performed given in matrix form.
optimal​_countthe optimal number of clusters where the dendrogram should be cut. This is a hint usually provided by the clustering algorithm that produces the dendrogram. None means that such a hint is not available; the optimal count will then be selected based on the modularity in such a case.
paramsadditional parameters to be stored in this object.
modularity​_paramsarguments that should be passed to Graph.modularity when the modularity is (re)calculated. If the original graph was weighted, you should pass a dictionary containing a weight key with the appropriate value here.
def __plot__(self, backend, context, *args, **kwds):

Draws the vertex dendrogram on the given Cairo context or matplotlib Axes

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

def as_clustering(self, n=None):
Cuts the dendrogram at the given level and returns a corresponding VertexClustering object.
Parameters
nthe 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. If None, the optimal count hint given by the clustering algorithm will be used If the optimal count was not given either, it will be calculated by selecting the level where the modularity is maximal.
Returns
a new VertexClustering object.
@optimal_count.setter
def optimal_count(self, value):

Undocumented

@property
optimal_count =

Returns the optimal number of clusters for this dendrogram.

If an optimal count hint was given at construction time, this property simply returns the hint. If such a count was not given, this method calculates the optimal number of clusters by maximizing the modularity along all the possible cuts in the dendrogram.

_graph =

Undocumented

_modularity_params: dict =

Undocumented

_names =

Undocumented

_optimal_count =

Undocumented