Applying Syntax Binning Rules

While running the Optimal Binning procedure, you requested that the binning rules generated by the procedure be saved as command syntax.

  1. Open bankloan_binning-rules.sps.
    Figure 1. Syntax rules file
    Syntax rules file

    For each binning input variable, there is a block of command syntax that performs the binning; sets the variable label, format, and level; and sets the value labels for the bins. These commands can be applied to a dataset with the same variables as bankloan_binning.sav.

  2. Open bankloan.sav. See the topic Sample Files for more information.
  3. Return to the Syntax Editor view of bankloan_binning-rules.sps.
  4. To apply the binning rules, from the Syntax Editor menus choose:

Run > All...

Figure 2. Binned variables for bankloan.sav in Data Editor
Binned variables for bankloan.sav in Data Editor

The variables in bankloan.sav have been binned according to the rules generated by running the Optimal Binning procedure on bankloan_binning.sav. This dataset is now ready for use in building predictive models that prefer or require categorical variables.

Next