"매 graph Laplacian 의 eigenvector 의 lower-dim embed → k-means". Spectral clustering 매 affinity-graph 매 cluster 의 detect, 매 non-convex / manifold 의 흐름 의 break (concentric circle, moons). 매 von Luxburg 2007 tutorial 의 canonical reference; 매 modern 매 Nyström approx + GPU eigen 의 large-scale.
fromsklearn.kernel_approximationimportNystroemfromsklearn.clusterimportKMeans# For N >> 10knys=Nystroem(kernel='rbf',gamma=0.1,n_components=300,random_state=0)X_low=nys.fit_transform(X)labels=KMeans(n_clusters=k,n_init=10).fit_predict(X_low)
언제: 매 affinity choice rationale, 매 eigengap interpretation, 매 sklearn pipeline scaffolding.
언제 X: 매 numerical eigendecomp (use scipy/PyTorch), 매 cluster validation 매 ground-truth needed.
❌ 안티패턴
Dense N×N for N>10k: 매 OOM. 매 k-NN sparse 의 use.
Sigma 의 untuned: 매 RBF kernel 매 useless. 매 median distance heuristic.
k 매 hand-pick: 매 eigengap heuristic 의 first try.
No symmetrization: 매 k-NN graph 의 directed → 매 complex eigenvalues.
Wrong Laplacian for unbalanced: 매 unnormalized 매 cluster size 의 sensitive. 매 L_{sym} default.
🧪 검증 / 중복
Verified (von Luxburg "A Tutorial on Spectral Clustering" 2007; Ng-Jordan-Weiss NIPS 2002; sklearn docs 1.5).