Convert a vector of unordered categorical data (either numeric or character labels) to a "one-hot" encoded matrix in which a 1 in a column indicates the presence of the relevant category.
oneHotEncode.Rd
This procedure assumes that a reference set of observations for this variable
(typically a training set that was used to sample a forest) has already been
one-hot encoded and that the unique levels of the training set variable are
available (and passed as unique_levels
). Test set observations that contain
categories not in unique_levels
will all be mapped to the last column of
this matrix