我尝试 public void OnUp (View view) {}
和caret
进行估算。他们都给出了错误
DMwR
数据包含数字,因子和逻辑列。
请下载数据here并加载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'
谢谢!
答案 0 :(得分:0)
Y
数据框中没有dat
列。您可以改为使用:
impu = preProcess(dat, method = c('knnImpute'))
dat1 = predict(impu, newdata = dat)