one_hot {mcboost}R Documentation

One-hot encode a factor variable

Description

One-hot encode a factor variable

Usage

one_hot(labels)

Arguments

labels

factor
Factor to encode.

Value

integer
Integer vector of encoded labels.

Examples

 ## Not run: 
 one_hot(factor(c("a", "b", "a")))
 
## End(Not run)

[Package mcboost version 0.4.3 Index]