How does Encoding Categorical Variables work
Short answer
Common techniques include one hot encoding, which creates a separate column for each category, and label encoding, which assigns each category a number.
Advertisement
AModel answer
Common techniques include one hot encoding, which creates a separate column for each category, and label encoding, which assigns each category a number.
Real-world example
A dataset with a color column containing red, blue, and green is one hot encoded into three separate numeric columns before training a model.
Likely follow-ups
- What is AI Data Preparation & Feature Engineering, How is Encoding Categorical Variables evaluated in practice, What tools are commonly used for Encoding Categorical Variables
Related topics