October 2017
Beginner to intermediate
270 pages
7h
English
Numerical or categorical information can easily be normally represented by integers, one for each option or discrete result. But there are situations where bins indicating the current option are preferred. This form of data representation is called one hot encoding. This encoding simply transforms a certain input into a binary array containing only zeros, except for the value indicated by the value of a variable, which will be one.
In the simple case of an integer, this will be the representation of the list [1, 3, 2, 4] in one hot encoding:
[[0 1 0 0 0] [0 0 0 1 0] [0 0 1 0 0] [0 0 0 0 1]]
Let's perform a simple implementation of a one hot integer encoder for integer arrays, in order to better understand the concept:
import ...
Read now
Unlock full access