R Package 'smbinning' V0.3

Optimal Binning for Scoring Modeling

Last Updated: 2017-08-19 Let's keep in touch : @hjopia hjopia


The package smbinning categorizes a numeric variable into bins or bands mapped to a binary target variable for its ulterior usage in scoring modeling. Its purpose is to automate the time consuming process of selecting the right cut points, quickly calculate metrics such as Weight of Evidence and Information Value (IV); and also document SQL codes, tables, and plots used throughout the development stage.
In its new Version 0.3, the package allows the user in one step (smbinning.eda) to see missing values and outliers for each characteristic in the dataset, along with basic statistics to better understand their distribution, and also in one step obtain the Information Value for each characteristic (smbinning.sumiv).
The desired outputs are basically the tables showed in the examples below, whose theory can be found in the following books:

* "Credit Scoring, Response Modeling, and Insurance Rating" (Finlay, 2010). See it [Here]
* "The Credit Scoring Toolkit" (Anderson, 2007). See it [Here]
* "Credit Risk Scorecards" (Siddiqi, 2006). See it [Here]

More details on:

* CRAN Repository [Here]
* Documentation (pdf) [Here]
* Video (v0.1) [Here]

What's New on Version 0.3?

* New function that calculates IV for all variables in one step.
* New function that plots and ranks IVs for each variable.
* New function for exploratory data analysis.
* New function that produces SQL code after binning factors.
* New function that generate variables after binning factors.
* Variables generated after binning now are factors with labels, instead of character.
* Modified dataset that allows a better understanding of the new functionalities.

Example: Credit Scoring for a Chilean Bank

The following outputs illustrate basic functionalities of smbinning using the dataset chileancredit included in the package. Download the R code [Here]

Table 1. Time on Books and Credit Performance via Optimal Binning. Plots from this output are shown in Figure 1 (Below).

Table 2. Time on Books and Credit Performance utilizing customized cutpoints.

Table 3. Income Levels and Credit Performance. The package allows users to take advantage of its functionalities to analyze factor variables.

Figure 1. Time on Books and Credit Performance plots after Optimal Binning (Table 1).

Table 4. Basic statistics to better understand each variable.

Table 5. Basic percentages that gives a different perspective of the numbers.

Table 6. IV for each characteristic of the dataset.

Figure 2. Plot the IV for each characteristic of the dataset.

Package History

* 2017-04-03: Package featured on Microsoft Github [Here]
* 2016-06-21: Version 0.3 available on CRAN (Happy!)
* 2015-06-15: Version 0.2 available on CRAN (Awesome!)
* 2015-03-24: Package featured on RevolutionAnalytics [Here]
* 2015-02-22: Package featured on Data Science Central [Here]
* 2015-02-16: Version 0.1 available as Binary Package, meaning, install.packages("smbinning") can be used to install it.
* 2015-02-15: Version 0.1 available on CRAN as a Source Package (Great!)
* 2014-10-19: Inception while writing about binning using recursive partitioning.