Skip to content
tomasgreif edited this page Jul 18, 2013 · 13 revisions

riv Package WoE and IV calculation

Introduction

Weight of Evidence (WoE) and Information Value (IV) are statistical measures frequently used in credit scoring. While IV is used to compare predictive power among many variables, WoE is used to recode original vaiables in a way that is well suited for logistic regression. riv package helps in calculating WoE and IV for character/factor variables and in binning of numeric variables. Binning for numeric variables is done using rpart (decision tree) model. As such, riv package is mainly useful for coarse classing. It offers the following features:

  • calculate IV for all or chosen variables in data frame (except target variable)
  • calculate WoE for all variables or chosen variables
  • transform raw variables to WoE
  • plot IV summary or WoE patterns

Installation

Package installation:

library(devtools)

install_github(repo="riv",username="tomasgreif")

library(riv)

Usage

Package demo:

demo(topic="iv.demo",package="riv")

Sample output

Summary IV plot for variables

Summary IV plot for variables.

WoE plot for variables

WoE plot for variables