R/helpers.R
one_hot.Rd
One-hot encode a factor variable
one_hot(labels)
factor Factor to encode.
factor
integer
Integer vector of encoded labels.
if (FALSE) { one_hot(factor(c("a", "b", "a"))) }