impute_knn: K-Nearest Neighbours imputation

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/impute.R

Description

The non-missing cases indicate the training set, and missing cases indicate the test set.

Usage

1
impute_knn(x, data, seed = 123456)

Arguments

x

clustering object

data

data matrix

seed

random seed for knn imputation reproducibility

Value

An object with (potentially not all) missing values imputed with K-Nearest Neighbours.

Note

We consider 5 nearest neighbours and the minimum vote for definite decision is 3.

Author(s)

Aline Talhouk

See Also

Other imputation functions: impute_missing

Examples

1
2
3
4
5
data(hgsc)
dat <- hgsc[1:100, 1:50]
x <- consensus_cluster(dat, nk = 4, reps = 4, algorithms = c("km", "hc",
"diana"), progress = FALSE)
x <- apply(x, 2:4, impute_knn, data = dat, seed = 1)

diceR documentation built on June 11, 2018, 5:04 p.m.