varimpact
varimpact copied to clipboard
Error in knn imputation
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.
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.