# Categorical

Categorical columns contain distinct categories. The defining aspect of a categorical column is that there is **a set number of predefined categories**.

The categories may be ordered or unordered. Ordered categories are known as *ordinal* while unordered categories are known as *nominal*.

![For example, you may be recording the credit card company of your users. This can only take on specific values like "VISA", "AMEX" or "DISCOVER". This is nominal because the categories don't have any order.](/files/uL8233ClMgjFtYyyDll2)

## General Categorical Transformers

These transformers encode your categorical values as numerical values, ready for data science and machine learning.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><a href="/pages/g2NPQSTLr1x6RQ2kBmFf"><strong>LabelEncoder</strong></a></td><td>Encode categories as numerical labels.</td><td><a href="/pages/g2NPQSTLr1x6RQ2kBmFf">/pages/g2NPQSTLr1x6RQ2kBmFf</a></td></tr><tr><td><a href="/pages/9WOvpV5S2TOZhTdJaWmH"><strong>OrderedLabelEncoder</strong></a></td><td>Encode categories as numerical labels using a pre-determined order.</td><td><a href="/pages/9WOvpV5S2TOZhTdJaWmH">/pages/9WOvpV5S2TOZhTdJaWmH</a></td></tr><tr><td><a href="/pages/7eoLpgHSWTSQRlNy3y0k"><strong>UniformEncoder</strong></a></td><td>Encode categories as a smooth distribution. Useful for imbalanced values.</td><td><a href="/pages/7eoLpgHSWTSQRlNy3y0k">/pages/7eoLpgHSWTSQRlNy3y0k</a></td></tr><tr><td><a href="/pages/i50fCAGFzBJw7YkUpiDY"><strong>OrderedUniformEncoder</strong></a></td><td>Encode categories as a smooth distribution using a pre-determined order. Useful for imbalanced values.</td><td><a href="/pages/i50fCAGFzBJw7YkUpiDY">/pages/i50fCAGFzBJw7YkUpiDY</a></td></tr><tr><td><a href="/pages/LBA20DkjwpOWjbIRm9Vp"><strong>FrequencyEncoder</strong></a></td><td>Encode categories into a multi-modal distribution by using a frequency-based analysis.</td><td><a href="/pages/LBA20DkjwpOWjbIRm9Vp">/pages/LBA20DkjwpOWjbIRm9Vp</a></td></tr><tr><td><a href="/pages/pTXQ15pRfQDD1VKNahB5"><strong>OneHotEncoder</strong></a></td><td>Encode categories into multiple, binary columns using one hot encoding.</td><td><a href="/pages/pTXQ15pRfQDD1VKNahB5">/pages/pTXQ15pRfQDD1VKNahB5</a></td></tr><tr><td><a href="/pages/kp3EuwajLC03j6o2wD4D"><strong>BinaryEncoder</strong></a></td><td>Encode boolean data as binary <code>0/1</code> labels.</td><td><a href="/pages/kp3EuwajLC03j6o2wD4D">/pages/kp3EuwajLC03j6o2wD4D</a></td></tr></tbody></table>

## Differential Privacy Transformers

These transformers use differential privacy techniques to add noise or reshape your column of categorical data. As a result, your column — and any statistics about it — can be shared with differential privacy guarantees.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td>❖ <a href="/pages/4u1DBqd3x6NZi17N9DtY"><strong>DPDiscreteECDFNormalizer</strong></a></td><td>Normalize the data by computing CDF function and adding noise.</td><td><a href="/pages/4u1DBqd3x6NZi17N9DtY">/pages/4u1DBqd3x6NZi17N9DtY</a></td></tr><tr><td>❖ <a href="/pages/pfW2a3NwWg8nLymIGoWn"><strong>DPResponseRandomizer</strong></a></td><td>Privatize the data by adding Laplacian noise randomly to each category.</td><td><a href="/pages/pfW2a3NwWg8nLymIGoWn">/pages/pfW2a3NwWg8nLymIGoWn</a></td></tr><tr><td>❖ <a href="/pages/i7YLADDiwklm2SfZukoy"><strong>DPWeightedResponseRandomizer</strong></a></td><td>Privatize the data by adding Laplacian noise in a weighted way, based on category frequencies.</td><td><a href="/pages/i7YLADDiwklm2SfZukoy">/pages/i7YLADDiwklm2SfZukoy</a></td></tr></tbody></table>

{% hint style="info" %}
❖ **SDV Enterprise Bundle**. This feature is available as part of the **Differential Privacy Bundle**, an optional add-on to SDV Enterprise. For more information, please visit the [Differential Privacy Bundle](https://docs.sdv.dev/sdv/reference/explore-sdv/differential-privacy-bundle) page. *Coming soon!*
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sdv.dev/rdt/transformers-glossary/categorical.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
