Home   >   User Resources   >   Online Help   >   apaClustering.Spectral.DBSCAN
 

 

Function index Version 3.0.0

apaClustering.Spectral.DBSCAN(LaplacianMatrix, nEigenvectors)

Excel=apaClustering.Spectral.DBSCAN(LaplacianMatrix, nEigenvectors)

Result

DBSCAN clustering on the spectral embedding of a Laplacian matrix. MinPoints is set to nEigenvectors + 1, Epsilon is calibrated as in apaClustering.DBSCAN.Epsilon. Returns an n x 1 vector of labels: -1 for noise points, clusters numbered from 0.

Syntax

LaplacianMatrix: n x n Laplacian matrix: L (apaGraph.LaplacianMatrix), L_sym (apaGraph.LaplacianMatrix.Sym) or L_rw (apaGraph.LaplacianMatrix.RW)

nEigenvectors: dimension s of the spectral embedding, i.e. the number of eigenvectors used, excluding the trivial eigenvector of the smallest eigenvalue; integer between 1 and n - 2. It does not set the number of clusters, which DBSCAN determines itself.

Remarks

The spectral embedding consists of the eigenvectors of the 2nd to (s + 1)-th smallest eigenvalues of LaplacianMatrix; the eigenvector of the smallest eigenvalue (constant for L and L_rw) carries no cluster information and is skipped.

Symmetric matrices (L, L_sym) are decomposed directly, by Householder tridiagonalization followed by the implicit QL algorithm. The random-walk Laplacian L_rw = D^-1 L is not symmetric; its eigenvectors are computed from the similar symmetric matrix D^1/2 L_rw D^-1/2 and transformed back with D^-1/2. The node weights D are recovered from L_rw itself. A non‑symmetric matrix that is not of the form D^-1 W with a symmetric W returns an error. Eigenvectors are scaled to unit length; their sign is arbitrary.

MinPoints = s + 1 follows the rule of thumb of at least one more point than the embedding dimension; Epsilon is the knee of the sorted distances of each point to its s-th nearest neighbor (DBSCAN counts the point itself).

The data points are the rows of the embedding. With the calibrated Epsilon and the small MinPoints, the method tends to split elongated or ring-shaped clusters into many small clusters; apaClustering.Spectral.kMeans is usually more robust when the number of clusters is known.

Pressing Esc aborts the calculation; the function then returns "Calculation aborted by user."