apply.categorical.mappings: Applies categorical mappings

Description Usage Arguments Value Author(s) Examples

View source: R/apply_categorical_mappings.R

Description

Applies feature engineered mapping tables for categorical features. Uses the output from the function map.categorical.encoding to apply these mappings.

Usage

1
2
apply.categorical.mappings(data, categorical.mappings, map.mode = "auto",
  progress = TRUE)

Arguments

data

[required | data.frame] Dataset containing features to apply mappings to

categorical.mappings

[required | list] Output from function map.categorical.encoding

map.mode

[optional | character | default="auto"] Type of mappings to apply. Options are auto, target, proportional, ordinal, onehot, onehot.prop, report, where auto is a combination between onehot and target. Tracking features are created which flags if a feature has a low proportional category in it. Other types of feature engineering includes, weighted mean noise target encoding, proportional encoding, ordinal proportional encoding, one hot encoding and low proportional one hot encoding which flags all low proportional categories as "other". Report cleans up levels so that the data can be represented in reports and charts.

progress

[optional | logical | default=TRUE] Display a progress bar

Value

Data frame with newly added features and original features

Author(s)

Xander Horn

Examples

1
2
ce <- map.categorical.encoding(data = iris,x = "Species", y = "Petal.Width")
new_iris <- apply.categorical.mappings(data = iris, categorical.mappings = ce)

XanderHorn/lazy documentation built on Jan. 16, 2021, 6:15 p.m.