categorical_iv: IV table for individual categorical variable

Description Usage Arguments Value Author(s) Examples

View source: R/functions.R

Description

The function takes base data, target and the categorical variable for which IV is to be calculated. It returns a dataframe with the WOE and IV value of the variable.

Usage

1
categorical_iv(base, target, variable, event = 1)

Arguments

base

input dataframe

target

column / field name for the target variable to be passed as string (must be 0/1 type)

variable

categorical variable name for which IV is to be calculated, to be passed as string

event

(optional) the event class, to be passed as 0 or 1 (default is 1)

Value

The function returns a dataframe.

Author(s)

Arya Poddar <aryapoddar290990@gmail.com>

Aiana Goyal <aianagoel002@gmail.com>

Examples

1
2
3
4
data <- iris
data$Species <- as.character(data$Species)
data$Y <- sample(0:1,size=nrow(data),replace=TRUE)
cat_iv <- categorical_iv(base = data,target = "Y",variable = "Species",event = 1)

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