encode_onehot: Encode categorical data using a one-hot aka one-of-K scheme

Description Usage Arguments Value

Description

Transforms categorical data (factor or character ot integer) to a format that works better with classification and regression algorithms.

Usage

1
encode_onehot(.data, ..., drop_first = TRUE, sep = "_")

Arguments

.data

A tbl.

...

One or more unquoted expressions separated by commas. You can treat variable names like they are positions. It supports [dplyr::select] comparable.

drop_first

bool, default TRUE Whether to get k-1 dummies out of k categorical levels (factor) by removing the first level.

sep

Separator between columns.

Value

An object of the same class as .data with "preprocessing-chain" attribution.


teramonagi/dpurifyr documentation built on May 29, 2019, 9:52 a.m.