ck37/varimpact

Error in knn imputation

ck37 opened this issue · 1 comments

ck37 commented

There seems to be an error with knn imputation when a row has multiple missing values (possibly all missing values or all except 1 missing values). We may need an na.rm somewhere, and/or we may want to change the default imputation back to median.

ck37 commented

The error appears to be in the predict() via caret:

data.numW = predict(impute_info, data.num)

Error in FUN(newX[, i], ...) : cannot impute when all predictors are missing in the new data point

Perhaps we can catch the error via try() and then fall back to imputation to the median just for those rows.