Home   >   User Resources   >   Online Help   >   apakNearestNeighbour.AdjacencyMatrix
 

 

Function index Version 3.0.0

apakNearestNeighbour.AdjacencyMatrix(k, DataMatrix, IsWeighted)

Excel=apakNearestNeighbour.AdjacencyMatrix(k, DataMatrix, IsWeighted)

Result

Turns the k nearest neighbors of each data point into an adjacency matrix.

Syntax

k: number of nearest neighbors to consider, between 0 (zero matrix) and c - 1

DataMatrix: r x c data matrix

IsWeighted: TRUE to use the distance information, FALSE to assume unit distances

Remarks

Data points i and j are linked if j is among the k nearest neighbors of i or i is among the k nearest neighbors of j, so the matrix is symmetric. With IsWeighted, the entries are Euclidean distances; data points with identical coordinates have distance 0 and therefore appear unlinked.

Neighbors are ranked by Euclidean distance; ties are broken by the lower column index. A data point is never its own neighbor, even if other data points have the same coordinates.

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