The Binning block enables you to group a variable into discrete categories.
The following demonstrates how to use the Binning block to categorise an input dataset loan_data.csv (containing observations each of which describes a completed loan and the person who took the loan out) using the numerical variable Income:
- Import the loan_data.csv dataset into a Workflow using the Text File Import block.
- Expand the Data Preparation group in the Workflow palette, then click and drag a Binning block onto the Workflow canvas.
- Click the Output port of the loan_data dataset block and drag a connection towards the Input port of the Binning block.
- Double-click the Binning block to display the Binning editor.
- Click Binning preferences to display the Preferences dialog box.
- In the Preferences dialog box, specify a Default bin count of 8. Click OK to close the Properties dialog box.
- In the Binning Variables pane:
- In the Unselected Variables list, select Income.
- Click Select to move the variable to the Selected Variables list.
![](sys_attachment.do?sys_id=e12e6e411b6a5914507ca6442a4bcb55)
- In the Binning Type pane:
- In the Binning Type dropdown list select Equal Width.
- Click Bin Variables
![](sys_attachment.do?sys_id=544ee2811b6a5914507ca6442a4bcb61)
The View Bins pane displays eight equal width bins for values of Income.
![](sys_attachment.do?sys_id=6b5ee6811b6a5914507ca6442a4bcbfe)
The Bin Statistics pane shows the number of observations in each bin and the percentage of the total number of observations they represent.
![](sys_attachment.do?sys_id=dc8e6e811b6a5914507ca6442a4bcb16)
- Close the Binning editor and save the configuration when prompted.
A green execution status is displayed in the Output port of the Binning block. The Binning block output dataset contains the input dataset plus a new variable (Income_bin) that identifies to which bin each observation belongs.
![](sys_attachment.do?sys_id=579ea2c11b6a5914507ca6442a4bcb1a)