Package schrodinger :: Package analysis :: Module cluster :: Class ClusterValues
[hide private]
[frames] | no frames]

Class ClusterValues

object --+
         |
        ClusterValues

Instance Methods [hide private]
 
__init__(self, values, n_clusters=8, **kmeans_args)
Cluster the specified list of values (e.g.
 
getClusterMemberships(self)
Returns a list corresponding to which cluster each value was assigned.
 
getClusteredValues(self)
Return a list of clustered values.
 
getClusterCenters(self)
Return a numpy array of cluster centroids.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, values, n_clusters=8, **kmeans_args)
(Constructor)

 

Cluster the specified list of values (e.g. coordinates) into the given number of clusters. NOTE: This clustering algorithm is an inherintly random process, so results from different runs may not be consistent.

Parameters:
  • values (List or numpy array of values to cluster. Each item can be a float or a list of floats (e.g. 3D coordinates).) - Values to cluster (will be cast into a numpy array)
  • n_clusters (int) - Number of clusters to generate.

    Other arguments are passed directly to KMeans.

Overrides: object.__init__

getClusterMemberships(self)

 

Returns a list corresponding to which cluster each value was assigned. The length of the list is equal to the number of the input values. Each value ranges from 0 to (number of output clusters-1).

getClusteredValues(self)

 

Return a list of clustered values. Outer list represents clusters, each item (cluster) will consist of one or more input values.