fuzzyclust.graph#
Graph-based fuzzy clustering.
Prototype-based algorithms describe a cluster by a simple geometrical object and therefore fail on arbitrarily shaped groups. The methods of this sub-package start from a graph over the samples instead:
MSTClustering– hybrid minimal spanning tree / Gath–Geva clustering: cut inconsistent tree edges (Zahn’s criteria), split further by the fuzzy hypervolume criterion, refine with GG (Vathy-Fogarassy, Feil, Abonyi 2005);GeodesicFCM– fuzzy c-medoids with geodesic (shortest-path) distances on a k-nearest-neighbor graph (Feil, Abonyi, Algorithm II);IsomapFCM– fuzzy c-means on the Isomap projection with re-projected centers (Feil, Abonyi, Algorithm I);minimum_spanning_tree(),neighbors_graph(),geodesic_distances(),isomap_embedding(),fuzzy_cluster_similarity()– the graph utilities behind them;plot_mst(),plot_neighbors_graph(),plot_geodesic_path(),plot_similarity_dendrogram()– matplotlib helpers;make_chained_blobs(),make_density_blobs(),make_s_curve()– data generators.
Everything is built on scipy.sparse.csgraph; networkx is an
optional backend of minimum_spanning_tree() only
(pip install fuzzyclust[graph]).
Minimal spanning tree based hybrid clustering and geodesic-distance fuzzy c-medoids.
Classes#
|
Hybrid clustering with a minimal spanning tree and Gath--Geva models. |
|
Geodesic-distance-based fuzzy c-medoid clustering (Feil and Abonyi, Algorithm II). |
|
Fuzzy c-means on the Isomap projection (Feil and Abonyi, Algorithm I). |
Functions#
|
Euclidean minimal spanning tree of the samples. |
Pairwise similarity of fuzzy clusters seen as fuzzy sets over the samples. |
|
|
Symmetric \(k\)-nearest-neighbor (or \(\varepsilon\)-radius) graph with Euclidean weights. |
|
Graph (geodesic) distances between all pairs of samples, Isomap style. |
|
Classical multidimensional scaling of a (geodesic) distance matrix (the Isomap projection). |
|
Draw the minimal spanning tree of a fitted |
|
Draw a neighborhood graph (sparse adjacency) over the data. |
|
Highlight the shortest graph path between two samples and the Euclidean chord. |
|
Dendrogram of fuzzy clusters built from their similarity matrix. |
|
Two Gaussian blobs connected by a sparse chain of points (the chaining effect). |
|
A diffuse cluster next to two tight ones (very different densities). |
|
Points on the three-dimensional S-curve, a two-dimensional manifold (wraps scikit-learn). |