fixCatProportions: Correct low proportional levels of categorical features

Description Usage Arguments Value Author(s) Examples

View source: R/fixCatProportions.R

Description

Corrects low proportions levels by investigating the proportion of data allocated to each level and replacing the level by a one called "_ALL_OTHER_" if the level is below the minimum percentage threshold

Usage

1
2
fixCatProportions(x, catFeats, minLevelPercentage = 0.025,
  autoCode = TRUE)

Arguments

x

[data.frame | Required] Data.frame containing categorical features

catFeats

[character vector | Required] Character vector of categorical features

minLevelPercentage

[numeric | Optional] Used to identify low proportional categorical levels. Default of 0.025

autoCode

[logical | Optional] Should code be generated when running the function

Value

List containing a data.frame with and a code list if autoCode is set to TRUE

Author(s)

Xander Horn

Examples

1
new <- fixCatProportions(x = iris, catFeats = "Species") # Proportions are all at 0.33 thus no change will occur

XanderHorn/autoML documentation built on Aug. 5, 2020, 11:45 a.m.