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:

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#

MSTClustering([n_clusters, threshold, ...])

Hybrid clustering with a minimal spanning tree and Gath--Geva models.

GeodesicFCM([n_clusters, n_neighbors, ...])

Geodesic-distance-based fuzzy c-medoid clustering (Feil and Abonyi, Algorithm II).

IsomapFCM([n_clusters, n_components, ...])

Fuzzy c-means on the Isomap projection (Feil and Abonyi, Algorithm I).

Functions#

minimum_spanning_tree(X[, backend])

Euclidean minimal spanning tree of the samples.

fuzzy_cluster_similarity(U)

Pairwise similarity of fuzzy clusters seen as fuzzy sets over the samples.

neighbors_graph(X[, n_neighbors, radius])

Symmetric \(k\)-nearest-neighbor (or \(\varepsilon\)-radius) graph with Euclidean weights.

geodesic_distances(X[, n_neighbors, radius, ...])

Graph (geodesic) distances between all pairs of samples, Isomap style.

isomap_embedding(D[, n_components])

Classical multidimensional scaling of a (geodesic) distance matrix (the Isomap projection).

plot_mst(X, model[, ax, labels, show_cuts, ...])

Draw the minimal spanning tree of a fitted MSTClustering.

plot_neighbors_graph(X, graph[, ax, labels, ...])

Draw a neighborhood graph (sparse adjacency) over the data.

plot_geodesic_path(X, graph, source, target)

Highlight the shortest graph path between two samples and the Euclidean chord.

plot_similarity_dendrogram(S[, ax, method, ...])

Dendrogram of fuzzy clusters built from their similarity matrix.

make_chained_blobs([n_samples_per_blob, ...])

Two Gaussian blobs connected by a sparse chain of points (the chaining effect).

make_density_blobs([sizes, spreads, ...])

A diffuse cluster next to two tight ones (very different densities).

make_s_curve([n_samples, noise, random_state])

Points on the three-dimensional S-curve, a two-dimensional manifold (wraps scikit-learn).