Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201839

Error when using ft_one_hot_encoder() in sparklyr

$
0
0

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:

enter image description here

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?


Viewing all articles
Browse latest Browse all 201839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>