knnImputation: knnImputation

Description Usage Arguments Details Value Author(s) Examples

View source: R/pguDMwR.R

Description

Imputes missings using kNN.

Usage

1
knnImputation(data, k = 10, scale = TRUE, meth = "weighAvg", distData = NULL)

Arguments

data

data frame containing missing values

k

number of nearest neighbors

scale

Indicates if data should be scaled

meth

Method for estimating the missing value

distData

Distance to the case

Details

Function that fills in all unknowns using the k Nearest Neighbours of each case with unknows. By default it uses the values of the neighbours and obtains an weighted (by the distance to the case) average of their values to fill in the unknows. If meth='median' it uses the median/most frequent value, instead. Taken from https://github.com/ltorgo/DMwR2/

Value

cleaned data

Author(s)

Luis Torgo

Examples

1
centralValue(x = seq(1,10,1))

pguIMP documentation built on Sept. 30, 2021, 5:08 p.m.