tune.knn.impute: tune the parameter k of the knn algorithm used in imputation.

View source: R/imputation.R

tune.knn.imputeR Documentation

tune the parameter k of the knn algorithm used in imputation.

Description

tune the parameter k of the knn algorithm used in imputation.

Usage

tune.knn.impute(
  data,
  cat.var = 1:ncol(data),
  k.min = 1,
  k.max = 20,
  frac.miss = 0.1,
  n.iter = 20,
  seed = 0
)

Arguments

data

a numerical matrix.

cat.var

vector containing the categorical variables

k.min

minimum value for k

k.max

maximum value for k

frac.miss

fraction of missing values to add

n.iter

number of iterations for each k

seed

random seed

Value

matrix of error distributions


bnstruct documentation built on Dec. 1, 2022, 1:22 a.m.