spectral_clustering: spectral_clustering

Description Usage Arguments Value Examples

View source: R/SpectralClustering.R

Description

spectral_clustering

Usage

1
2
spectral_clustering(A, k, type = c("rw", "sym", "unnormalized"),
  verbose = FALSE)

Arguments

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

Value

a numeric vector as class labels

Examples

1
2
3
D = matrix(runif(400), nrow = 20)
A = affinity_matrix(D, 5)
labels = spectral_clustering(A, k=2)

Example output



ANF documentation built on Nov. 8, 2020, 7:51 p.m.