Skip to main content
. 2022 May 7;22(9):3557. doi: 10.3390/s22093557
Algorithm 2: Proposed PCA-based subspace clustering.
  • Input: Data X, number of subspaces k, sampling size n, regularization parameter λ1 and λ2, neighborhood threshold dmax, residual minimization parameter m, affinity threshold tmax.

  • Output: The label vector l of all points in X with clustered values.
    •  1. The uniform sampling of n points X˜ from X is performed.
    •  2. The subclusters are constructed.
    •  3. Implement PCA on the subclusters.
    •  4. An affinity matrix is constructed.
    •  5. The adjacency matrix is sparsified.
      •   For j=1tondo
      •   w:=[D]j
      •   For i=1tondo
      •   If [D]ijw(ndmax), then
      •    |D|ij:=0
      •    End
      •   End
    •  6. Cluster X˜:setD:=D+DT.
    •  7. Sample points in X˜ are clustered by implementing spectral clustering on D.
    •  8. Indicate the labels of X˜ by lin.
    •  9. The label of the entire dataset X is obtained by combining lin and lout so that the entire l can be obtained and the clustering is performed successfully.