Рет қаралды 2,026
A categorical variable is used to represent categories or labels. Machine learning (ML) and deep learning (DL) models only work with numerical variables. Therefore, we will need to convert a categorical variable into numerical values to be able to feed them into an ML or DL model. Traditionally, we convert categorical variables into numbers by either one hot encoding or label encoding. However, those two approaches become problematic when we have a large number of categories or when there are no explicit ordering across categories.
In categorical embedding, each categorical variable category is mapped to an n-dimension vector. This mapping is learned by a neural network during a standard supervised training process. After that, we will replace each category with their corresponding vectors in our data. The advantages of categorical embeddings are: (1) We can limit the number of columns we need per category. This is useful when a variable has many categories; and (2) The generated embeddings obtained from the neural network reveals the intrinsic properties of categorical variables, meaning that similar categories will have similar embeddings.
This tutorial shows how to create categorical embeddings for ML or DL models.
Code used in this video can be downloaded from GitHub:
github.com/Dre...
Hashtags: #tutorial #tutorials #categorical #embedding #encoding #artificialintelligence #machinelearning #deeplearning #python #pythonprogramming #pythontutorial #aitutorial #coding #neuralnetworks #neuralnetwork