KNN: k-nearest neighbour (KNN)

View source: R/KNN.R

KNNR Documentation

k-nearest neighbour (KNN)

Description

The fraction of k-nearest neighbours in the original data that are preserved as k-nearest neighbours in imputed data. KNN quantifies preservation of the local, or microscopic structure. Requires complete datasets - for developers/use in benchmark studies only.

Usage

KNN(xorigin, ximputed, k = 3)

Arguments

xorigin

numeric matrix. The original log-intensity data. Can not contain missing values.

ximputed

numeric matrix. The imputed log-intensity data. Can not contain missing values.

k

number of nearest neighbours. default to k=3.

Value

numeric The proportion of preserved k-nearest neighbours in imputed data.

Examples

data(pxd007959)
y <- pxd007959$y
y <- y[complete.cases(y),]
# for demonstration we use same y for xorigin and ximputed
KNN(y, y)



DavisLaboratory/msImpute documentation built on Jan. 5, 2024, 3:50 a.m.