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

prep_data impute doesn't work with numeric_method = knnimpute #1254

Closed
NateGarrettHC opened this issue Sep 6, 2018 · 1 comment
Closed
Assignees

Comments

@NateGarrettHC
Copy link
Contributor

The following code is an example of prep_data not working for knnimpute:
test <- prep_data(d,
outcome=atherosclerosis,
impute=list(numeric_method="knnimpute"))

Here is the error:
Error in gower_work(x = x, y = y, pair_x = pair_x, pair_y = pair_y, n = n, :
STRING_ELT() can only be applied to a 'character vector', not a 'integer'

numeric_method="bagimpute" or "mean" work properly.

@glenrs
Copy link
Contributor

glenrs commented Oct 4, 2018

@NateGarrettHC thanks for this issue!

I filed this issue for recipes. The problem lies in their library. I have found that recipes::step_knnimpute fails when character columns are provided instead of factor columns. As a short term solution, please convert your columns to factor columns. We will be issuing this as a warning until recipes fixes this issue.

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

2 participants