Skip to main content
. 2022 May 7;22(9):3557. doi: 10.3390/s22093557
Algorithm 1: Spectral clustering process with a metric ρ.
  • Input: (data) {xi}i=1n, (kernel function) fσ, and (scaling parameter) σ>0

  • Output: Y(labels) with clustered values
    •  1. The weight matrix Wn×n is computed with Wij=fσ(ρ(xi,xj)).
    •  2. The diagonal degree matrix Dn×n is computed with Dii=j=1nWij.
    •  3. The symmetric normalized Laplacian LSYM=ID12WD12 is formed.
    •  4. The eigendecomposition {(ϕk,λk)}k=1n is computed and sorted so that 0=λ1λ2λn.
    •  5. The number of clusters K is estimated as: K^=argmaxkλk+1λk.
    •  6. The row normalized spectral embedding is defined by vi=(ϕ1(xi),ϕ2(xi),,ϕk^(xi))/ϕ1(xi),ϕ2(xi),,ϕk^(xi)2 for 1in.
    •  7. By implementing K-means on the data {vi}i=1n, the labels Y are computed by utilizing K^ as the total number of clusters, thereby implementing the concept of clustering successfully.