fuzzyclust.relational#
Fuzzy clustering of relational, categorical and mixed data.
The prototype-based algorithms of fuzzyclust.cluster need feature
vectors: a mean and a Euclidean distance. This sub-package covers the
cases where the objects are not vectors or where the mean makes no
sense – only pairwise dissimilarities are known (time series compared by
dynamic time warping, documents, graphs), the attributes are categorical,
or numeric and categorical attributes are mixed:
RelationalFCM– relational fuzzy c-means, the exact dual of FCM on a matrix of squared Euclidean distances (Hathaway, Davenport, Bezdek 1989);NERFCM– NERF c-means, relational c-means made robust to non-Euclidean matrices by the adaptive \(\beta\)-spread (Hathaway, Bezdek 1994);FuzzyCMedoids– fuzzy c-medoids with object prototypes, the linear-complexity candidate search and the trimmed variant (Krishnapuram, Joshi, Nasraoui, Yi 2001);FuzzyKModes– fuzzy k-modes for categorical data with the matching dissimilarity and membership-mass modes (Huang, Ng 1999);FuzzyKPrototypes– fuzzy k-prototypes for mixed data with the weight \(\gamma\) (Huang 1998);pairwise_dissimilarity(),dtw_distance_matrix(),dtw_alignment(),autocorrelation_distance_matrix(),autocorrelation_features(),gower_distance_matrix(),matching_dissimilarity(),relational_distances(),check_dissimilarity_matrix()– dissimilarity helpers;plot_dissimilarity_matrix(),plot_dtw_alignment(),plot_modes(),plot_series_clusters()– matplotlib helpers;make_categorical_blobs(),make_mixed_blobs(),make_warped_series()– data generators.
The relational estimators follow scikit-learn’s convention:
metric="precomputed" makes fit take the square dissimilarity
matrix and predict_proba the rectangular matrix of new objects
against the training objects; any other metric name computes the matrix
from feature vectors.
Relational FCM, NERF c-means, fuzzy c-medoids, fuzzy k-modes and k-prototypes, DTW / autocorrelation / Gower dissimilarities.
Classes#
|
Relational fuzzy c-means (Hathaway, Davenport and Bezdek, 1989). |
|
Non-Euclidean relational fuzzy c-means (Hathaway and Bezdek, 1994). |
|
Fuzzy c-medoids clustering of relational data (Krishnapuram et al., 2001). |
|
Fuzzy k-modes clustering of categorical data (Huang and Ng, 1999). |
|
Fuzzy k-prototypes clustering of mixed numeric and categorical data (Huang, 1998). |
Functions#
|
Squared relational distances of the training objects to relational prototypes. |
|
Simple matching dissimilarity \(\delta(\mathbf{a},\mathbf{b})=\sum_j[a_j\neq b_j]\) between rows. |
|
Pairwise dissimilarities of feature vectors by any SciPy metric. |
|
Validate a (square or rectangular) dissimilarity matrix. |
|
Dynamic time warping distances between all pairs of (equal-length) series. |
|
Optimal warping path between two series (for inspection and plotting). |
|
Sample autocorrelations \(\hat\rho(1),\dots,\hat\rho(L)\) of every series. |
|
Autocorrelation-based distance between time series (D'Urso and Maharaj, 2009). |
|
Gower's general coefficient of dissimilarity for mixed data (Gower, 1971). |
|
Heat map of a dissimilarity matrix with the objects ordered by their labels. |
|
Two series with the dynamic-time-warping correspondences between them. |
|
Table of the fitted modes, shaded by how much membership mass the mode carries. |
|
Time series drawn in the color of their cluster, medoid series emphasized. |
|
Categorical records scattered around planted modes. |
|
Records with Gaussian numeric attributes and categorical attributes around modes. |
|
Time series of three shape classes with random time warps. |