View source: R/trans_one_hot.R
| one_hot | R Documentation |
A daltoolbox::dal_transform() that one-hot encodes the categorical columns (factor,
character or logical) of a data frame. It learns the categories at fit() and, at transform(),
always produces the same columns: a category absent from a batch becomes a zero column and an
unseen category is ignored. Numeric columns are kept unchanged. It is the default first step of
the preprocessing of adp_recurrent().
one_hot()
A one_hot object.
library(daltoolbox)
oh <- fit(one_hot(), iris)
head(transform(oh, iris))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.