Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in knn imputation #7

Open
ck37 opened this issue Dec 14, 2017 · 1 comment
Open

Error in knn imputation #7

ck37 opened this issue Dec 14, 2017 · 1 comment
Assignees

Comments

@ck37
Copy link
Owner

ck37 commented Dec 14, 2017

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 ck37 self-assigned this Dec 14, 2017
@ck37
Copy link
Owner Author

ck37 commented Dec 14, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant