Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

find_weights

Calculate weight matrix.


Description

Calculates the weights for every neighbour of x_i.

Usage

find_weights(nns, X, m, reg = 2, ss = FALSE, p = 0.5, id = FALSE, v = 0.99)

Arguments

nns

matrix of nearest neighbours using find_nn_k or find_nn_eps.

X

matrix object containing the input data.

m

intrinsic dimension of the data. See lle.

reg

regularisation method. See lle.

ss

a logical values indicating wheather to perform subset selection. See lle.

p

amount of data remaining after subset selection. See lle.

id

a logical values indicating wheather to calculate the intrinsic dimension. See lle.

v

threshold parameter for intrinsic dimension. See details.

Value

A list containing the following variables:

X

input data, can change if subset selection is applied

weights

weight matrix. If x_i is neighbour of x_j then -1<weights[i,j]<1, else zero.

choise

index vector of kept data while subset selection

id

additionally to the (optional) printed intrinsic dimension, the vector of intrinsic dimension for every data point is returned by the function, so that the vector can easily be ploted manually.

Examples

data( lle_scurve_data )
	X <- lle_scurve_data
	nns <- find_nn_k( X, 5 )
	weights <- find_weights( nns, X, 2, 2 )

lle

Locally linear embedding

v1.1
GPL-3
Authors
Holger Diedrich, Dr. Markus Abel (Department of Physics, University Potsdam)
Initial release
2012-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.