【发布时间】:2016-02-23 15:05:40
【问题描述】:
我尝试了 caret 和 DMwR 进行估算。他们都给出了错误
Y = 35
impu = preProcess(dat[, -Y], method = c('knnImpute'))
dat1 = predict(impu, newdata = dat[, -Y])
# Error in `[.data.frame`(old, , non_missing_cols, drop = FALSE) :
# undefined columns selected
dat1 = knnImputation(dat, scale = T, meth='median')
# Error in scale.default(xcomplete, dm[i, ], FALSE) :
# length of 'center' must equal the number of columns of 'x'
数据包含数值、因子和逻辑列。
请下载数据here并用load('data2013.RData')加载
谢谢!
【问题讨论】:
标签: r r-caret imputation