# 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.](https://2225246359-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVGX92M819eIp0rMg5elc%2Fuploads%2F0bThYSM3yPAxeJJT3CME%2Frdt_transformers-glossary-categorical_June%2002%202025.png?alt=media\&token=f02aeef6-ff07-4232-9078-9be7b5795a40)

## 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="categorical/labelencoder"><strong>LabelEncoder</strong></a></td><td>Encode categories as numerical labels.</td><td><a href="categorical/labelencoder">labelencoder</a></td></tr><tr><td><a href="categorical/orderedlabelencoder"><strong>OrderedLabelEncoder</strong></a></td><td>Encode categories as numerical labels using a pre-determined order.</td><td><a href="categorical/orderedlabelencoder">orderedlabelencoder</a></td></tr><tr><td><a href="categorical/uniformencoder"><strong>UniformEncoder</strong></a></td><td>Encode categories as a smooth distribution. Useful for imbalanced values.</td><td><a href="categorical/uniformencoder">uniformencoder</a></td></tr><tr><td><a href="categorical/ordereduniformencoder"><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="categorical/ordereduniformencoder">ordereduniformencoder</a></td></tr><tr><td><a href="categorical/frequencyencoder"><strong>FrequencyEncoder</strong></a></td><td>Encode categories into a multi-modal distribution by using a frequency-based analysis.</td><td><a href="categorical/frequencyencoder">frequencyencoder</a></td></tr><tr><td><a href="categorical/onehotencoder"><strong>OneHotEncoder</strong></a></td><td>Encode categories into multiple, binary columns using one hot encoding.</td><td><a href="categorical/onehotencoder">onehotencoder</a></td></tr><tr><td><a href="categorical/binaryencoder"><strong>BinaryEncoder</strong></a></td><td>Encode boolean data as binary <code>0/1</code> labels.</td><td><a href="categorical/binaryencoder">binaryencoder</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="categorical/dpdiscreteecdfnormalizer"><strong>DPDiscreteECDFNormalizer</strong></a></td><td>Normalize the data by computing CDF function and adding noise.</td><td><a href="categorical/dpdiscreteecdfnormalizer">dpdiscreteecdfnormalizer</a></td></tr><tr><td>❖ <a href="categorical/dpresponserandomizer"><strong>DPResponseRandomizer</strong></a></td><td>Privatize the data by adding Laplacian noise randomly to each category.</td><td><a href="categorical/dpresponserandomizer">dpresponserandomizer</a></td></tr><tr><td>❖ <a href="categorical/dpweightedresponserandomizer"><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="categorical/dpweightedresponserandomizer">dpweightedresponserandomizer</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 %}
