The clus module

This module is a part of the pyOMA2 package and provides utility functions to support the implementation of clustering algorithms.

Functions:
  • kmeans(): Perform k-means clustering on the given feature array.

  • GMM(): Perform Gaussian Mixture Model (GMM) clustering on the given feature array.

  • hierarc(): Perform hierarchical clustering with specified parameters.

  • spectral(): Perform spectral clustering with the given similarity matrix.

  • affinity(): Perform affinity propagation clustering on the given similarity matrix.

  • optics(): Perform OPTICS clustering on the given pairwise distance matrix.

  • hdbscan(): Perform HDBSCAN clustering on the given pairwise distance matrix.

  • reorder_clusters(): Reorder cluster labels based on ascending frequencies values.

  • post_freq_lim(): Filter clusters based on specified frequency range.

  • post_fn_med(): Filter clusters based on a median frequency threshold.

  • post_fn_IQR(): Filter clusters based on the interquartile range (IQR) of frequencies.

  • post_xi_IQR(): Filter clusters based on the interquartile range (IQR) of damping values.

  • post_min_size(): Filter clusters based on a minimum cluster size.

  • post_min_size_pctg(): Filter clusters based on a percentage of the largest cluster size.

  • post_min_size_kmeans(): Filter clusters based on size using k-means clustering.

  • post_min_size_gmm(): Filter clusters based on size using Gaussian Mixture Model (GMM).

  • post_merge_similar(): Merge clusters that are similar based on inter-medoid distances.

  • post_1xorder(): Ensure only one sample per order in each cluster.

  • post_MTT(): Ensure only one sample per order in each cluster.

  • output_selection(): Select output results based on the specified selection method.

  • MTT(): Apply the Modified Thompson Tau technique to remove outliers.

  • filter_fl_list(): Filter and extract stable elements from a list of feature arrays.

  • vectorize_features(): Vectorize features by flattening them and indexing valid (non-NaN) entries.

  • build_tot_simil(): Compute a total similarity matrix by combining multiple distance matrices with weights.

  • build_tot_dist(): Compute a total distance matrix by combining multiple distance matrices with weights.

  • build_feature_array(): Build a feature array from multiple distance metrics with optional transformations.

  • oned_to_2d(): Convert a 1D array to a 2D array based on order and shape.

  • UnionFind: A Union-Find data structure for efficient disjoint set operations.

  • relative_difference_abs(): Compute the relative absolute difference between two values.

  • MAC_difference(): Compute the Modal Assurance Criterion (MAC) difference between two mode shapes.

  • dist_all_f(): Compute a pairwise distance matrix for a flattened 1D array using relative absolute difference.

  • dist_all_phi(): Compute a pairwise distance matrix for 3D mode shape data using the MAC difference.

  • dist_all_complex(): Compute pairwise relative distances for a 1D array of complex numbers.

  • dist_n_n1_f(): Compute distances between successive columns of a 2D array using relative differences.

  • dist_n_n1_phi(): Compute distances between successive columns of a 3D mode shape array using MAC differences.

  • dist_n_n1_f_complex(): Compute distances between successive columns of a 2D complex array using relative differences.

  • dist_all_complex(): Compute pairwise relative distances for a 1D array of complex numbers.

  • dist_all_complex(): Compute pairwise relative distances for a 1D array of complex numbers.

  • dist_all_complex(): Compute pairwise relative distances for a 1D array of complex numbers.