spectral_clustering: spectral_clustering

View source: R/SpectralClustering.R

spectral_clusteringR Documentation

spectral_clustering

Description

spectral_clustering

Usage

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

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

BeautyOfWeb/ANF documentation built on Feb. 18, 2024, 5:03 p.m.