K-Nearest Neighbours imputation
The non-missing cases indicate the training set, and missing cases indicate the test set.
impute_knn(x, data, seed = 123456)
x |
clustering object |
data |
data matrix |
seed |
random seed for knn imputation reproducibility |
An object with (potentially not all) missing values imputed with K-Nearest Neighbours.
We consider 5 nearest neighbours and the minimum vote for definite decision is 3.
Aline Talhouk
Other imputation functions:
impute_missing()
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)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.