July 2017
Intermediate to advanced
796 pages
18h 55m
English
A one-hot encoding maps a column of label indices to a column of binary vectors, with at most a single value. This encoding allows algorithms that expect continuous features, such as Logistic Regression, to use categorical features. Suppose you have some categorical data in the following format (the same that we used for describing the StringIndexer in the previous section):

Now, we want to index the name column so that the most frequent name in the dataset (that is, Jason in our case) gets index 0. However, what's the use of just indexing them? In other words, you can further vectorize ...
Read now
Unlock full access