Learn Before
Code

Spectral Clustering Algorithm

Algorithm: Input: Similarity Matrix and number of clusters kk. 1. Represent all data points as nodes in a graph. 2. Build the similarity graph given a similarity matrix. Calculate its weighted adjacency matrix WW. Let it have dimensionality nimesnn imes n. 3. Build the unnormalized Laplacian LL (nimesnn imes n). 4. If we wish to cluster the data into kk clusters (user-defined), then we consider the first kk eigenvectors of the matrix LL. 5. Build an nimeskn imes k matrix with each of the first kk eigenvectors as its columns. Let us call this matrix MM. 6. Interpret each ROW of the matrix MM as a separate data point aia_i. 7. Run the k-means clustering algorithm to put these distinct aia_i data points into clusters.

0

1

Updated 2026-05-16

Tags

Data Science