graphclust.cluster.SpectralGraphClustering#
- class graphclust.cluster.SpectralGraphClustering(n_clusters=2, *, affinity='self_tuning', k=10, max_clusters=10, random_state=None)[source]#
Bases:
ClusterMixin,BaseEstimatorNormalized spectral clustering (Ng, Jordan and Weiss 2002) on a neighborhood graph.
Affinities:
"self_tuning": \(a_{ij}=\exp(-d_{ij}^2/(\sigma_i\sigma_j))\) on the symmetrick-NN graph with local scales \(\sigma_i\) = distance to thek-th neighbor (Zelnik-Manor and Perona 2004);"fuzzy": the fuzzy neighborhood similarity matrix;"precomputed":Xis an affinity matrix.
The
n_clustersleading eigenvectors of \(\mathbf{D}^{-1/2}\mathbf{A}\mathbf{D}^{-1/2}\) are row-normalized and clustered with k-means. Withn_clusters="auto"the number of clusters is taken at the largest relative gap of the Laplacian eigenvalues \(\mu_l=1-\lambda_l\) among the firstmax_clusters(graphclust.validity.eigengap()).