# Bin a Categorical Field

## Bin a Categorical Field

Categorical fields are modeled as a separate field for each distinct category. So a field with a large number of categories cannot be modeled. Use this dialog to see if the field can be reduced to a smaller number of categories by combining together small occurance categories. This is accessible through the Configure dialog.

This dialog is an interface on top of the [Expression Builder](https://github.com/asisupport/ADVIZOR-Help-V2/tree/26d8b1cd60d32eb467f6cec93d8a5eda808ecb7d/using-views/expression-builder.md) "bin()" function. You can also create a "bin()" expression directly.

See [Predictive Analytics](https://github.com/asisupport/ADVIZOR-Help-V2/tree/26d8b1cd60d32eb467f6cec93d8a5eda808ecb7d/predictive-analytics-analystx.md) for a detailed discussion of the modeling capabilities in ADVIZOR AnalystX. Review the overall Analytics [process](https://help.advizorsolutions.com/v7.2+/using-advizor/model-ribbon/analytics-process) to see how this dialog fits into it.

## Creating a New Model

Bin a categorical field like this:

![](https://1916279106-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lf5YcsNySU3Og8Ms9rA%2F-Lf5ZCyAZIyYzxDLDEKS%2F-Lf5ZzJ6pHfsEm1tNvBX%2FBin%20a%20Categorical%20Field.PNG?generation=1558109747725307\&alt=media)

1. **Categorical Fields**: This box lists all categorical fields in the table chose for modeling. Click a field name to see more details about it.
2. **Original Categories**: The number of unique categories in the original field.
3. **After Binning**: The number of unique categories after the field is binned. Binning is done using the **Create** button (below).
4. **Group Name**: The name used for the group formed from low frequency categories.
5. **Coverage**: This is the percentage of the data with the highest occurance categories where the categories are unchanaged. Data is aggregated by row count and ordered; after this threshold, all remaining bins are give the "other" Group Name

   This works best if there are a small number of categories that are common and a large number of low occurrance categories. The low occurance categories are summarized into a single, new category.
6. **Binned Field**: The name of the new field produced. This cannot be modified by the user.
7. **Create**: Create the new field with reduced categories.&#x20;
8. **Remove**: Remove a new field that was created. This happens immediately and is not undone by **Cancel** (below).&#x20;
9. **Help**: Display assistance on using this dialog.&#x20;
10. **OK**: Close the dialog and update the Model Configuration dialog with any changes.&#x20;
11. **Cancel**: Close the dialog and discard any changes.&#x20;

If **OK** is used to close the dialog, any newly binned fields are added to the Model Configuration, and the base field is removed. **Cancel** causes all additions to be forgotten. **Remove** actions, however, are not reversed by **Cancel**.

This dialog creates a "bin()" expression to do the binning, which is recorded with the project so that it will be run when the project is refreshed.

**See Also:**

* [Overview](https://github.com/asisupport/ADVIZOR-Help-V2/tree/26d8b1cd60d32eb467f6cec93d8a5eda808ecb7d/predictive-analytics-analystx.md)
* [Process](https://help.advizorsolutions.com/v7.2+/using-advizor/model-ribbon/analytics-process)
* [Predictive Modeling View](https://help.advizorsolutions.com/v7.2+/using-advizor/model-ribbon/predictive-modeling-view)
* [Configure Model](https://help.advizorsolutions.com/v7.2+/using-advizor/model-ribbon/configuring-a-model)
