iv.replace.woe: Replace raw variables with Weight of Evidence

Description Usage Arguments Examples

Description

Replaces variables in data frame with Weight of Evidence. This will add new columns with "_woe" suffix to specified data frame.

Usage

1
  iv.replace.woe(df, iv, verbose = FALSE)

Arguments

df

data frame with original data

iv

list of information values for variables - output from iv.mult with summary=FALSE.

verbose

Prints additional details when TRUE. Useful mainly for debugging.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Replace WoE for list of variables
outiv <- iv.mult(german_data,"gb",vars=c("ca_status","housing","duration"))
x <- iv.replace.woe(german_data,outiv)
str(x)

# Replace WoE for all variables
outiv <- iv.mult(german_data,"gb")
x <- iv.replace.woe(german_data,outiv)
str(x)

# Replace WoE for all numeric variables- ultimate one-liner
x <- iv.replace.woe(german_data,iv.mult(german_data,"gb",vars=varlist(german_data,"numeric")))
str(x)

tomasgreif/woe documentation built on May 31, 2019, 5:16 p.m.