I have a dataset with a categorical variable that I want to encode using one-hot encoding in sparklyr
. Below is the table head, and the code I'm using:
tbl_name %>%
ft_one_hot_encoder(input_col="category",output_col="category_x")
However, I'm getting the following error:
java.lang.IllegalArgumentException: requirement failed: Input column must be of type numeric but got string
. I may be missing something here, but how can the input column of the one-hot encoder be numeric?