Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aurélien Géron
Author:Aurélien Géron
Language: eng
Format: epub, pdf
Publisher: O'Reilly Media
Published: 2019-09-25T16:00:00+00:00
Tip
As a rule of thumb, if the number of categories is lower than 10, then one-hot encoding is generally the way to go (but your mileage may vary!). If the number of categories is greater than 50 (which is often the case when you use hash buckets), then embeddings are usually preferable. In between 10 and 50 categories, you may want to experiment with both options and see which one works best for your use case.
Encoding Categorical Features Using Embeddings
An embedding is a trainable dense vector that represents a category. By default, embeddings are initialized randomly, so for example the "NEAR BAY" category could be represented initially by a random vector such as [0.131, 0.890], while the "NEAR OCEAN" category might be represented by another random vector such as [0.631, 0.791]. In this example, we use 2D embeddings, but the number of dimensions is a hyperparameter you can tweak. Since these embeddings are trainable, they will gradually improve during training; and as they represent fairly similar categories, Gradient Descent will certainly end up pushing them closer together, while it will tend to move them away from the "INLAND" category’s embedding (see Figure 13-4). Indeed, the better the representation, the easier it will be for the neural network to make accurate predictions, so training tends to make embeddings useful representations of the categories. This is called representation learning (we will see other types of representation learning in Chapter 17).
Download
Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow by Aurélien Géron.pdf
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.
Computer Vision & Pattern Recognition | Expert Systems |
Intelligence & Semantics | Machine Theory |
Natural Language Processing | Neural Networks |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8292)
Test-Driven Development with Java by Alan Mellor(6655)
Data Augmentation with Python by Duc Haba(6561)
Principles of Data Fabric by Sonia Mezzetta(6321)
Learn Blender Simulations the Right Way by Stephen Pearson(6209)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6083)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5474)
Big Data Analysis with Python by Ivan Marin(5327)
The Infinite Retina by Robert Scoble Irena Cronin(5174)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5139)
Pretrain Vision and Large Language Models in Python by Emily Webber(4288)
Infrastructure as Code for Beginners by Russ McKendrick(4049)
Functional Programming in JavaScript by Mantyla Dan(4037)
The Age of Surveillance Capitalism by Shoshana Zuboff(3943)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3761)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3565)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3539)
