graphclust.cluster.GraphCommunityClustering#
- class graphclust.cluster.GraphCommunityClustering(k=15, *, graph='jaccard', method='louvain', resolution=1.0, random_state=None)[source]#
Bases:
ClusterMixin,BaseEstimatorCommunity detection on a neighborhood graph (PhenoGraph-style pipeline).
Build a graph:
"jaccard"(kNN graph with Jaccard weights, i.e. the first-order fuzzy neighborhood similarity),"knn"(binary symmetric kNN graph) or"fuzzy"(transitive fuzzy neighborhood similarity, sparsified to the kNN pairs).Maximize modularity with
method:"louvain"(Blondel et al. 2008, vianetworkx);"leiden"(Traag, Waltman and van Eck 2019; uses the optional packagesleidenalgandpython-igraphand falls back to Louvain with a warning if they are missing);"label_propagation"(Raghavan et al. 2007);"greedy"(Clauset–Newman–Moore).
resolution> 1 favors smaller communities. The number of clusters is not an input: it follows from the graph and the resolution.