Ask or search…


Compatibility: categorical data
The OneHotEncoder transforms data that represents unordered, categorical values into multiple columns -- one for each category. These new columns have 0 and 1 values. A 1 indicates the correct, original category.
In this example, VISA is encoded in the credit_card.value0 column, AMEX is encoded in the credit_card.value1 column, etc.
from rdt.transformers.categorical import OneHotEncoder
ohe = OneHotEncoder()
The OneHotEncoder creates a new column for each category in your input data. If you have a large number of categories, it will create a large number of new columns. Each extra column uses more memory and increases the RDT processing time. If this is a concern, consider using other transformers like the LabelEncoder instead.


No parameters are available for this transformer.


What happens to missing values?
This transformer treats missing values as if they are a new category of data.