graphclust: graph-based clustering and data visualization in Python#

graphclust

graphclust is a scikit-learn compatible toolbox for clustering and visualizing data through graphs. It is the Python successor of the MATLAB toolbox that accompanied the monograph Graph-Based Clustering and Data Visualization Algorithms (Á. Vathy-Fogarassy, J. Abonyi, Springer, 2013), extended with the main graph-based methods published since then.

Graphs from data

kNN, ε, MST, relative neighborhood, Gabriel and Delaunay graphs, shared neighbors, geodesic distances.

graphclust.graphs
Topology learning

Neural gas, topology representing networks, GNG, GWR, DTRN, WINN.

graphclust.vq
Clustering with trees

Zahn’s MST clustering, hybrid MST–Gath–Geva, HDBSCAN*, density peaks.

graphclust.cluster
Shared neighbors and communities

Jarvis–Patrick, fuzzy neighborhood similarity, SNN, spectral clustering, Louvain and Leiden.

graphclust.cluster
Maps

Sammon, MDS, LPP, SOM, Isomap, Isotop, CDA, OVI-NG, GNLP-NG, TRNMap, diffusion maps, UMAP, t-SNE.

graphclust.manifold
Assessment

VAT/iVAT, trustworthiness, continuity, co-ranking, DBCV.

graphclust.metrics

Quick start#

pip install graphclust
from graphclust import TRNMap, HybridMSTGG
from graphclust.datasets import make_s_curve, make_chainlink

X, t = make_s_curve(2000, random_state=0)
tm = TRNMap(n_nodes=150, random_state=0).fit(X)
tm.embedding_          # map positions of the nodes
tm.transform(X)        # map positions of the samples

Xc, yc = make_chainlink()
HybridMSTGG(max_clusters=4, lambda_=2.5).fit(Xc).labels_

Where to go next#