pod: Finding optimal discrete solutions for spectral clustering

Description Usage Arguments Value References Examples

View source: R/SpectralClustering.R

Description

Finding optimal discrete solutions for spectral clustering

Usage

1
pod(Y, verbose = FALSE)

Arguments

Y

a matrix with N rows and K columns, with N being the number of objects (e.g., patients), K being the number of clusters. The K columns of 'Y' should correspond to the first k eigenvectors of graph Laplacian matrix (of affinity matrix) corresponding to the k smallest eigenvalues

verbose

logical(1); if true, print some information

Value

class assignment matrix with the same shape as Y (i.e., N x K). Each row contains all zeros except one 1. For instance, if X_ij = 1, then object (eg, patient) i belongs to cluster j.

References

Stella, X. Yu, and Jianbo Shi. "Multiclass spectral clustering." ICCV. IEEE, 2003.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
D = matrix(runif(400),20)
A = affinity_matrix(D, 5)
d = rowSums(A)
L = diag(d) - A
# `NL` is graph Laplacian of affinity matrix `A`
NL = diag(1/d) %*% L
e = eigen(NL)
# Here we select eigenvectors corresponding to three smallest eigenvalues 
Y = Re(e$vectors[,-1:-17])
X = pod(Y)

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