graphclust: graph-based clustering and data visualization in Python#
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.
kNN, ε, MST, relative neighborhood, Gabriel and Delaunay graphs, shared neighbors, geodesic distances.
Neural gas, topology representing networks, GNG, GWR, DTRN, WINN.
Zahn’s MST clustering, hybrid MST–Gath–Geva, HDBSCAN*, density peaks.
Jarvis–Patrick, fuzzy neighborhood similarity, SNN, spectral clustering, Louvain and Leiden.
Sammon, MDS, LPP, SOM, Isomap, Isotop, CDA, OVI-NG, GNLP-NG, TRNMap, diffusion maps, UMAP, t-SNE.
VAT/iVAT, trustworthiness, continuity, co-ranking, DBCV.
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#
Installation: requirements and optional extras.
Example gallery: the example gallery, one runnable script per method, each downloadable as a Jupyter notebook.
The book: the book Graph-Based Clustering and Data Visualization in Python.
API reference: the API reference.
Migrating from the MATLAB toolbox: coming from the MATLAB toolbox.