Skip to content
Quantoros

What do we do with categorical variables?

Classic MLLevel: IntermediateClassification

What do we do with categorical variables?

Hints
  • State the task, inputs and prediction target.
  • Compare with a simple baseline: assumptions, objective and independent validation.

Answer

Categorical variables must be encoded before they can be used as features to train a machine learning model. There are various encoding techniques, including:

  • One-hot encoding
  • Label encoding
  • Ordinal encoding
  • Target encoding

Source and licence: Alexey Grigorev & contributors — Data Science Interviews · CC-BY-4.0

Related questions