Building Machine Learning and Deep Learning Models on Google Cloud Platform by Ekaba Bisong

Building Machine Learning and Deep Learning Models on Google Cloud Platform by Ekaba Bisong

Author:Ekaba Bisong
Language: eng
Format: epub
ISBN: 9781484244708
Publisher: Apress


One-Hot Encoding

In a classification problem, one-hot encoding is the process of transforming the class labels of the target variable into a matrix of binary variables. The one-hot encoder assigns 1 when the output belongs to a particular class and 0 otherwise. An illustration of one-hot encoding is shown in Figure 29-4.

Figure 29-4One-hot encoding

In the final layer of the neural network, just before the output layer, an activation function called the softmax (same as discussed under “Logistic Regression”) is applied to transform the activations to the probability that the example belongs to one of the output classes.

The purpose of applying one-hot encoding to the labels of the dataset is to represent the output as a vector of distinct classes with the probability that an example in the training dataset belongs to any one of the output categories.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.