schrodinger.analysis.cluster module

Provides a class for clustering a set of values - for example, 3D coordinates.

@copyright: Schrodinger, LLC. All rights reserved.

class schrodinger.analysis.cluster.ClusterValues(values, n_clusters=8, **kmeans_args)

Bases: object

getClusterMemberships()

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).

Used by the unit test to verify that the clustering works correctly.

getClusteredValues()

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

getClusterCenters()

Return a numpy array of cluster centroids.