Package rdkit :: Package ML :: Package Cluster :: Module ClusterUtils

[hide private]
[frames] | no frames]

# Module ClusterUtils

source code

    utility functions for clustering

Functions | [hide private]

GetNodeList(cluster) returns an ordered list of all nodes below cluster | source code

GetNodesDownToCentroids(cluster, above=1) returns an ordered list of all nodes below cluster | source code

FindClusterCentroidFromDists(cluster, dists) find the point in a cluster which has the smallest summed Euclidean distance to all others | source code

_BreadthFirstSplit(cluster, n) *Internal Use Only* | source code

_HeightFirstSplit(cluster, n) *Internal Use Only* | source code

SplitIntoNClusters(cluster, n, breadthFirst=1) splits a cluster tree into a set of branches | source code

Variables | [hide private]

| __package__ = `None` hash(x)

Function Details | [hide private]

### GetNodeList(cluster)

source code

    returns an ordered list of all nodes below cluster

    the ordering is done using the lengths of the child nodes

     **Arguments**

       - cluster: the cluster in question

     **Returns**

       - a list of the leaves below this cluster

### FindClusterCentroidFromDists(cluster, dists)

source code

    find the point in a cluster which has the smallest summed
      Euclidean distance to all others

    **Arguments**

      - cluster: the cluster to work with

      - dists: the distance matrix to use for the points

    **Returns**

      - the index of the centroid point

### SplitIntoNClusters(cluster, n, breadthFirst=1)

source code

    splits a cluster tree into a set of branches

    **Arguments**

      - cluster: the root of the cluster tree

      - n: the number of clusters to include in the split

      - breadthFirst: toggles breadth first (vs depth first) cleavage
        of the cluster tree.

    **Returns**

      - a list of sub clusters