(Abstract) base class / mixin that Clusterers can extend. Provides convenience functions for the user.
To implement a clusterer using this base class, subclass it and define your init method to do the clustering you want, and then set self._generator_indices, self._assignments, and self._distances with the result.
For convenience (and to enable some of its functionality), let BaseFlatCluster prepare the trajectories for you by calling BaseFlatClusterer’s __init__ method and then using the prepared, concatenated trajectory self.ptraj for your clustering.
Methods
__init__(metric[, trajectories, ...]) | |
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 |