Learn R Programming

diceR (version 3.0.0)

impute_knn: K-Nearest Neighbours imputation

Description

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

Usage

impute_knn(x, data, seed = 123456)

Value

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

Arguments

x

clustering object

data

data matrix

seed

random seed for knn imputation reproducibility

Author

Aline Talhouk

See Also

Other imputation functions: impute_missing()

Examples

Run this code
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)

Run the code above in your browser using DataLab