Remarks
The dendrogram remains valid for the chosen metric and HierarchicalClusteringLinkage as long as the graph did not change in between. This can be used to efficiently cluster the same graph again with a different number of clusters or a different cut-off value for dissimilarity using either changeClusterCount or changeCutoff.
This class cannot be instantiated
See Also
Developer's Guide
Members
Properties
Gets a collection of all clusters in the graph.
See Also
Developer's Guide
Gets the root of the dendrogram which is used internally to generate the clusters.
Initially each node comprises its own cluster. At each step of the clustering algorithm, two clusters are merged together until all nodes belong to the same cluster. The tree which is generated this way is stored as a dendrogram. The dendrogram's leaves thus represent clusters that each contain a single node. The dendrogram's root represents a cluster that contains every node of the graph.
The actual clusters can be calculated for a cluster count using changeClusterCount or for a cut-off value using changeCutoff.
The dendrogram's root can be null if the original graph was empty.
See Also
Developer's Guide
API
- getDendrogramNode
Gets a mapping from each node to its cluster ID.
-1.Gets a mapping from each node to its cluster.
Methods
Creates a new HierarchicalClusteringResult with the given number of clusters.
Parameters
- clusterCount: number
- The cluster count. Must be positive; if it's greater than the number of nodes in the graph, the number of clusters in the result is equal to the number of nodes.
Return Value
- HierarchicalClusteringResult
- A new HierarchicalClusteringResult with the same dendrogramRoot and clusters calculated based on that dendrogram and the
clusterCount.
See Also
Developer's Guide
Creates a new HierarchicalClusteringResult with clusters based on the given cutoff value.
Parameters
- cutoff: number
- The cutoff value for the clusters' dissimilarity.
Return Value
- HierarchicalClusteringResult
- A new HierarchicalClusteringResult with the same dendrogramRoot and clusters calculated based on that dendrogram and
cutoff.
See Also
Developer's Guide
Gets the representative of node in the dendrogram.
node in the dendrogram.The representative of node is one of the dendrogram's leaves which represents the cluster that only contains the node.
If a subgraph is specified, this method returns null if node is not part of the subgraph.
Parameters
- node: INode
- The node for which to retrieve the representative in the dendrogram.
Return Value
- DendrogramNode
- The representative of
nodein the dendrogram.