The BINNING Procedure

PROC BINNING Statement

  • PROC BINNING <options>;

The PROC BINNING statement invokes the procedure. Table 1 summarizes important options in the PROC BINNING statement by function.

Table 1: PROC BINNING Statement Options

Option Description
Basic Option
DATA= Specifies the input data table
Precision Option
FUZZYCOMPARE= Specifies the fuzzy comparison threshold that is used to determine the distinctness of numeric values
Binning Level Options
DISTINCTCOUNTLIMIT= Specifies the maximum number of distinct levels for interval variables in order for them to be treated as nominal variables
NUMBIN= Specifies the global number of bins for all binning variables
Binning Method Option
METHOD= Specifies which binning method to use
Tolerance Option
PERCENTILETOLERANCE= Specifies the tolerance for percentile computation
Maximum Iterations Option
PERCENTILEMAXITERATIONS=
Specifies the maximum iterations for percentile computation
Weight-of-Evidence Option
WOE(WOEADJUST=) Computes the weight of evidence and information values
Missing Value Handling Options
BINMISSING= Specifies whether to use missing values of the input variables for the binning process
MISSINGBINSTATS= Specifies whether to use the bin that contains the missing values for binning analysis
MISSINGEVALNONEVENT= Specifies whether to consider missing values of the target variable as nonevents
Format Option
RAW= Specifies whether to process variables by using their raw values or formatted values


You can specify the following options:

BINMISSING=TRUE | FALSE

specifies whether to use missing values of the input variables for the binning process. You can specify either of the following values:

TRUE

places all missing values into a bin whose binId=0.

FALSE

ignores all missing values.

By default, BINMISSING=TRUE.

DATA=CAS-libref.data-table

names the input data table for PROC BINNING to use. The default is the most recently created data table. CAS-libref.data-table is a two-level name, where

CAS-libref

refers to a collection of information that is defined in the LIBNAME statement and includes the caslib, which includes a path to the data, and a session identifier, which defaults to the active session but which can be explicitly defined in the LIBNAME statement. For more information about CAS-libref, see the section Using CAS Sessions and CAS Engine Librefs.

data-table

specifies the name of the input data table.

FUZZYCOMPARE=value

specifies the fuzzy comparison threshold that is used to determine the distinctness of numeric values. The range for this option is 0 to 1E–5.

By default, FUZZYCOMPARE=1E–10.

METHOD=BUCKET | CUTPTS(numlist) | QUANTILE | TREE <options> | WINSOR(RATE=rate)

specifies which binning method to use.

You can specify one of the following methods:

BUCKET

uses the bucket binning method. Only interval input variables are supported for this binning method.

CUTPTS(numlist)

uses the cutpoints binning method and specifies the lower and upper bounds of the bin. The numbers in numlist specify the upper bounds of each bin except the last bin (whose upper bound is positive infinity). Each number in numlist also implies the lower bound of the next bin; the lower bound of the first bin is negative infinity. Only interval input variables are supported for this binning method.

QUANTILE

uses the quantile binning method. Only interval input variables are supported for this binning method.

TREE <options>

uses the tree-based binning method. Both interval and nominal input variables are supported for this binning method. You can specify the following options:

CRITERIA <options>

specifies the criteria for growing the tree for the tree-based binning method. You can specify the following options:

GAIN
ENTROPY

uses the gain in information (decrease in entropy) as the tree-growing criterion. This criterion is available only for a nominal target.

GAINRATIO
ENTROPYRATIO

uses the gain ratio in information (decrease in entropy ratio) as the tree-growing criterion. This criterion is available only for a nominal target. This is the default criterion for a nominal target.

GINI

uses the Gini statistic as the tree-growing criterion. This criterion is available only for a nominal target.

SSE

uses the sum of squared error as the tree-growing criterion. This criterion is available only for an interval target. This is the default criterion for an interval target.

DISTINCTCOUNTLIMIT=integer
MAXDISTINCTLEVELS=integer

specifies the maximum number of distinct levels that interval variables can have in order for them to be treated as nominal variables, where integer can be any integer between 2 and 30,000, inclusive. You can use the LEVEL= option in the INPUT statement to treat interval variables as nominal variables as long as their levels are less than integer.

By default, DISTINCTCOUNTLIMIT=5000.

INITBIN=integer

specifies the initial number of bins for interval input variables to start the tree-based binning process. The final number of bins created by PROC BINNING might be different than the number you specify. The value of integer can be any integer between 1 and 10,000, inclusive. By default, INITBIN=100.

INITMETHOD=BUCKET | QUANTILE

specifies the method to initialize the tree-based binning for interval input variables. You can specify either of the following values:

BUCKET

uses the bucket binning method.

QUANTILE

uses the quantile binning method.

By default, the bucket binning method is used.

LEAFSIZE=integer
MINNOBSINBIN=integer

specifies the allowed minimum number of observations per leaf for tree-based binning. The value of integer can be any integer between 1 and 30,000. There is no default. If you specify this option, the number of observations in each leaf will be larger than the specified integer.

MAXNBINS=integer

specifies the desired maximum number of bins for all variables. The value of integer can be any integer between 2 and 10,000, inclusive. If this option is specified, PROC BINNING tries to make sure that the final number of bins for all variables is no more than the specified integer. By default, MAXNBINS=5.

MINNBINS=integer

specifies the desired minimum number of bins for all variables. The value of integer can be any integer between 1 and 10,000, inclusive. If this option is specified, PROC BINNING tries to make sure that the final number of bins for all variables is no less than the specified integer. By default, MINNBINS=1.

WINSOR(RATE=rate)

uses the Winsorized binning method and specifies the rate that it uses. You must specify a rate between 0 and 0.5, exclusive. Only interval input variables are supported for this binning method.

MISSINGBINSTATS=TRUE | FALSE

specifies whether to use the bin that contains the missing values for binning analysis such as WOE and IV. You can specify either of the following values:

TRUE

uses the bin that contains the missing values (binId=0) for binning analysis.

FALSE

ignores the bin that contains the missing values.

By default, MISSINGBINSTATS=TRUE.

MISSINGEVALNONEVENT=TRUE | FALSE

specifies whether to consider missing values of the target variable as nonevents. You can specify either of the following values:

TRUE

considers missing values of the target variable to be nonevents.

FALSE

excludes missing values of the target variable from analysis.

By default, MISSINGEVALNONEVENT=FALSE.

NUMBIN=integer

specifies the global number of binning levels for all binning variables. The value of integer can be any integer between 2 and 1000, inclusive.

By default, NUMBIN=16.

In tree-based binning, this option is ignored.

PERCENTILETOLERANCE=value

specifies the tolerance for percentile computation.

By default, PERCENTILETOLERANCE=1E–5.

PERCENTILEMAXITERATIONS=value

specifies the maximum number of iterations for percentile computation.

By default, PERCENTILEMAXITERATIONS=10.

RAW=TRUE | FALSE

specifies whether to process variables by using their raw values or formatted values. You can specify either of the following values:

TRUE

processes variables by using their raw values.

FALSE

if a variable has format, processes it by using a formatted value.

By default, RAW=TRUE.

WOE(WOEADJUST=number)

computes the weight of evidence and information values. In tree-based binning, this option is ignored. You can specify the following suboption:

WOEADJUST=number

specifies the adjustment factor for the weight-of-evidence calculation, where number is between 0 and 1, inclusive.

By default, WOEADJUST=0.5.

Last updated: September 13, 2022