View source: R/SpectralClustering.R
spectral_clustering | R Documentation |
spectral_clustering
spectral_clustering(A, k, type = c("rw", "sym", "unnormalized"),
verbose = FALSE)
A |
affinity matrix |
k |
the number of clusters |
type |
choose one of three versions of graph Laplacian: "unnormalized": unnormalized graph Laplacian matrix (L = D - W); "rw": normalization closely related to random walk (L = I - D^(-1)*W); (default choice) "sym": normalized symmetric matrix (L = I - D^(-0.5) * W * D^(-0.5)) For more information: https://www.cs.cmu.edu/~aarti/Class/10701/readings/Luxburg06_TR.pdf |
verbose |
logical(1); if true, print user-friendly information |
a numeric vector as class labels
D = matrix(runif(400), nrow = 20)
A = affinity_matrix(D, 5)
labels = spectral_clustering(A, k=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.