{"id":1817,"date":"2020-04-10T16:22:44","date_gmt":"2020-04-10T13:22:44","guid":{"rendered":"http:\/\/beeeye.com\/?p=1817"},"modified":"2021-04-10T23:59:47","modified_gmt":"2021-04-10T23:59:47","slug":"weight-of-evidence-woe-implementation","status":"publish","type":"post","link":"http:\/\/beeeye.com\/weight-of-evidence-woe-implementation\/","title":{"rendered":"Guest blog: Weight of Evidence, Information Value, and Population Stability Index: Background and implementation notes"},"content":{"rendered":"
<\/p>\n

We are thrilled to have a guest post in our blog<\/a> by Dr. Hershel Safer<\/a><\/strong>. Dr.Safer is an expert in taking the most advanced mathematics, statistics and machine learning techniques and generating the most robust credit risk models<\/a> possible. Through many years of experience in research and development of models, Dr.Safer has developed a set of guidelines which prove essential when developing new credit risk models. In this guest blog post, we’d like to share his cookbook for the development of some of the most basic functions used in modelling: Weight of Evidence (WOE), Information Value (IV) and PSI (Population Stability Index).<\/p>\n

Introduction<\/h2>\n

In credit risk modelling, as in other fields where a predictive model is built based on raw historical data, preparing the data for the training is the most crucial stage in the creation of a strong model. The statistical nature of many raw features is often not perfectly aligned with the requirements of various training algorithms and may result in inferior models. Thus, preparing the data properly will yield stronger results.<\/p>\n

In credit risk, as in other areas of financial and behavioral modelling, certain scenarios occur repeatedly. Applying the appropriate data transformations can yield vastly improved results. This post explores several such functions along with the relevant mathematical and statistical details. The post can provide a solid foundation for understanding, implementing, and using these functions in your modelling projects.<\/p>\n

In this post, the term \u201ccharacteristic\u201d means \u201cvariable\u201d or \u201cfeature.\u201d An \u201cattribute\u201d is a specific value taken by a characteristic. This terminology is not universal in machine learning, but it is common in the credit risk literature.<\/p>\n

Weight of Evidence (WOE)<\/h2>\n

Weight of Evidence (WOE) is used to assess the predictive value of individual attribute values of a characteristic.<\/p>\n

Suppose that the sample has \"n\" negative instances and \"p\" positives, with \"n_j\" and \"p_j\" being the numbers of negative and positive instances with attribute \"j\". A common way to represent the data for a characteristic with \"k\" attributes is a \"k times 2\" table. Each row corresponds to an attribute and each column to a value of \"Y\" (0 or 1). Each cell contains the number of observations with the corresponding attribute and target values.<\/p>\n

The WOE for attribute \"j\" is \"w_j = ln left(nicefrac{frac{n_j}{n}}{frac{p_j}{p}} right)\". This can be rewritten as \"w_j = ln left( nicefrac{n_j}{p_j} right) - ln left( nicefrac{n}{p} right)\"; this highlights WOE as being the difference between the log odds of the attribute and the population log odds. Attributes with log odds close to that of the population have little WOE.<\/p>\n

The Weight of Evidence (WOE) transformation replaces each attribute with a risk value. When \"w_j > 0\", the probability of observing \"Y=0\" for instances with attribute \"j\" is above average for the sample, and vice versa for \"w_j < 0\". WOE also standardizes each characteristic, so the parameters in logistic regression can be directly compared.<\/p>\n

Implementation notes:<\/h4>\n