msmbuilder.clustering.Clarans.__init__

Clarans.__init__(metric, trajectories=None, prep_trajectories=None, k=None, num_local_minima=10, max_neighbors=20, local_swap=False)[source]

Run the CLARANS clustering algorithm on the frames in a trajectory

Parameters:

metric : msmbuilder.metrics.AbstractDistanceMetric

A metric capable of handling ptraj

trajectory : Trajectory or list of msmbuilder.Trajectory

data to cluster

k : int

number of desired clusters

num_local_minima : int

number of local minima in the set of all possible clusterings to identify. Execution time will scale linearly with this parameter. The best of these local minima will be returned.

max_neighbors : int

number of rejected swaps in a row necessary to declare a proposed clustering a local minima

local_swap : bool, optional

If true, proposed swaps will be between a medoid and a data point currently assigned to that medoid. If false, the data point for the proposed swap is selected randomly.

See also

_kcenters
implementation
SubsampledClarans
random subsampling version (faster)