A minimalist package for converting a categorical data matrices to one hot encoded binary matrices.
devtools::install_github('dannymorris/onehotter')
The make_onehot()
function is used for one hot encoding. Setting
scale = T
will perform scaling accounting for class probabilities.
df <- data.frame(sex = sample(c("male", "female", "unkn"), 100, T), party = sample(c("dem", "rep", "other"), 100, T)) make_onehot(data = df) make_onehot(data = df, scale = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.