num_to_cat: Binning numerical variables based on cuts from IV table

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

The function takes the num_woe_table output from a class "iv_table". Based on the split points from the num_woe_table, the numerical variables are binned into categories.

Usage

1
num_to_cat(base, num_woe_table, num_missing = -99999)

Arguments

base

input dataframe

num_woe_table

num_woe_table class from iv table output

num_missing

(optional) imputed missing value for numerical variable (default value is -99999)

Value

The function returns a dataframe after converting the numerical variables into categorical classes.

Author(s)

Arya Poddar <aryapoddar290990@gmail.com>

Examples

1
2
3
4
5
data <- iris
data$Y <- sample(0:1,size=nrow(data),replace=TRUE)
x <- c("Sepal.Length","Sepal.Width","Petal.Length","Petal.Width")
iv_table_list <- iv_table(base = data,target = "Y",num_var_name = x,cat_var_name = "Species")
num_cat <- num_to_cat(base = data,num_woe_table = iv_table_list$num_woe_table)

scorecardModelUtils documentation built on May 2, 2019, 9:59 a.m.