msmbuilder.clustering.Clarans

class msmbuilder.clustering.Clarans(metric, trajectories=None, prep_trajectories=None, k=None, num_local_minima=10, max_neighbors=20, local_swap=False)[source]
__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)

Methods

__init__(metric[, trajectories, ...]) Run the CLARANS clustering algorithm on the frames in a trajectory
get_assignments Assign the trajectories you passed into the constructor based on
get_distances Extract the distance from each frame to its assigned cluster kcenter
get_generator_indices Get the generator indices corresponding to frames in self.ptraj.
get_generators_as_traj Get a trajectory containing the generators
Versions