Learn R Programming

lle (version 1.1)

find_nn_k: Find k nearest neighbours.

Description

Finds the nearest k points for every point of the input data.

Usage

find_nn_k(X, k, iLLE = FALSE)

Arguments

X
matrix object containing the input data.
k
number of neighbours.
iLLE
a logical values indicating wheater to use improved LLE. See lle.

Value

neighbours
matrix with $N$ rows and columns. If $x_j$ is a neighbour of $x_i$ then $neighbours[i,j]$ is one, else zero.

See Also

find_nn_eps

Examples

Run this code
	data( lle_scurve_data )
	X <- lle_scurve_data
	neighbours <- find_nn_k( X, 5 )
	table( rowSums( neighbours ) )

Run the code above in your browser using DataLab