December 2018
Intermediate to advanced
158 pages
3h 58m
English
What do we do when a feature is a set of categories rather than a number? Suppose we are building a model to predict house prices. A feature of this model could be the cladding material of the house, with possible values such as timber, iron, and cement. How can we encode this feature to be of use to a deep learning model? The obvious solution is to simply assign a real number to each category: say, 1 for timber, 2 for iron, and 3 for cement. The problem with this representation is that it infers that the category values are ordered. That is, timber and iron are somehow closer than timber and cement.
A solution that avoids this is one-hot encoding. The feature values are encoded as binary vectors, as shown in ...
Read now
Unlock full access