Check out the Free (Big) Data analysis of 4D-STEM workshop in Trondheim, Norway, 11-13 June 2024

cluster#

DiffractionVectors.cluster(method, columns=None, column_scale_factors=None, min_vectors=None, remove_nan=True)[source]#

This method clusters a list of vectors both in reciprocal space and in real space. The output is a list of vectors with a “label” which defines the cluster that each vector belongs to. Vectors with a label==-1 are outliers which are ignored.

Parameters:
  • method (sklearn.base.ClusterMixin) – The method used to cluster the vectors

  • columns (list) – The columns of the data to use for clustering.

  • column_scale_factors (list) – The scale factors to apply to the columns of the data.

  • min_vectors (int) – A strict check to limit clusters arising from less than min_vectors vectors

  • remove_nan (bool) – If True, vectors with NaN values are removed before clustering