onehotter

A minimalist package for converting a categorical data matrices to one hot encoded binary matrices.

Install

devtools::install_github('dannymorris/onehotter')

Usage

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)


dannymorris/onehotter documentation built on May 15, 2019, 9:08 p.m.