OPTBINNING Procedure

Overview: OPTBINNING Procedure

The OPTBINNING procedure is an enhancement of a traditional binning algorithm for fitting a credit scoring model. Credit scoring can be defined as a statistical modeling technique that is used to assign risk to credit applicants or to existing credit accounts.

A binning variable is usually called a characteristic in this context. Age, income, and outstanding loans are typical characteristics that influence the value of an applicant’s credit score. For example, a 27-year-old applicant for a loan might find that her credit score is based on the fact that she falls into the 24–30 age group.

Usually, attributes such as age, income, and so on, are segmented into grouping intervals, with the aim of creating bins for scorecards that maximize correlation according to these attributes. A critical aspect of the binning process is the enforcement of various constraints, such as minimum/maximum number of bins, minimum/maximum bin widths, maximum number of observations per bin, and additional variables and constraints related to the "weight of evidence" (WOE). These requirements significantly complicate the binning process.

One approach to creating a binning solution is to build it incrementally, starting with a fine discretization of the data (for example, every age is an initial bin) and merging bins in some sequential manner. This approach has been used traditionally, and some variant of it is found in many credit applications. Consider the following example as an illustration of the challenges that software or analysts face when attempting to bin a characteristic in this manner. Suppose that at a particular processing stage a given bin does not satisfy the requirement for minimum number of observations. You can try to increase this bin’s count by moving the left or right knot and thus increase the bin’s range. However, this decreases the range of neighboring bins, meaning that they can now potentially violate this or another constraint, even if it was previously satisfied. It might be better to merge this bin with a neighboring bin, but it is not clear which bin to choose, and it is not clear how this action will affect all other bins. The merged bin might in fact be too large and violate the maximum number of observations constraint, or it might violate only the maximum number of "bad" observations constraint. Merging always affects the total bin count constraint, and the aggregate WOE curve might no longer be monotonic. Merging somewhere else might have been a better way to maintain monotonicity. If you start with an initial collection of bins to be fixed, it might not even be clear which bin to focus on first. Because any future configuration will depend on the choices made at a particular phase, you can easily force yourself into an infeasible situation even when perfectly feasible solutions exist.

Despite (or because of) this complexity, much of the current binning for score engineering is performed or at least adjusted manually (perhaps aided by visual or heuristic tools). Yet there are strong incentives to automate tedious portions of this process. Several factors drive these incentives:

  • Cost: Many analyst hours might be necessary if a large number of constraints are to be simultaneously satisfied. This is because the combinatorial nature of the problem defies intuitive, heuristic, or sequential approaches.

  • Feasibility: It is entirely possible that a collection of constraints is so restrictive that no solution exists that would satisfy all constraints simultaneously. Mathematically, this is stated as an empty feasible set. Attempting to bin by intuitive methods does not reveal this fact until it is "felt" that all options have been exhausted (after considerable time and effort, and even then without any certainty). It would be best to have an a priori guarantee that if a feasible solution exists, it will be found. This implies that all constraints will be correctly satisfied.

  • Optimality: Intuitive approaches are heuristic in nature and cannot guard against finding only suboptimal solutions. It also might be impossible to prove that a global optimal solution has already been found, leading to unnecessary work in a fruitless attempt to improve it. Rigorous consideration of optimality is critical because it has a direct impact on the predictive power of the final score.

The OPTBINNING procedure applies optimization techniques in order to automate the binning process, which aims to address each of the preceding factors by solving the binning problem in a computationally efficient manner while detecting infeasibility and proving optimality with mathematical certainty.

The underlying mathematical model translates this problem into a graph representation, where the shortest path algorithm is then applied. It is not important to understand the graph representation in order to use the procedure.

The graph is constructed by defining nodes for each fine bin, and edges for each allowable coarse bin construction. The graph is constructed such that constraints are automatically satisfied for each edge (node pairs). If a decision is made by the shortest path algorithm to use an arc, then the two nodes that define the arc represent the coarse bin delimiters. The cost of edge is given by the deviation of WOE of each coarse bin from the WOE of the fine bin. The path of lowest cost is the one that chooses the delimiters in such a way that the total deviation of WOEs from coarse to fine bins is minimized.

Last updated: August 06, 2026