Library
Hands-On Machine Learning

Deep learning and craft

Hands-On Machine Learning

Aurélien Géron · O'Reilly Media · 3rd edition, 2022

The argument

Géron teaches machine learning by building working systems. The book assumes you can program, and takes you from classical scikit-learn models to deep neural networks in Keras and TensorFlow, with code for every idea. Its second theme is process: the second chapter walks one project from framing the problem to launching, monitoring and maintaining it, before the algorithms get any depth.

How the book is built

  1. 01

    The landscape and an end-to-end project

    Chapters 1 and 2

    Chapter 1 defines machine learning, sorts systems by supervision, batch versus online learning and instance-based versus model-based learning, and lists the main challenges: too little data, nonrepresentative or poor-quality data, irrelevant features, overfitting and underfitting, plus testing, validation and data mismatch. Chapter 2 is a full project on real data: frame the problem, pick a performance measure, build a test set, explore and visualize, prepare the data with pipelines, train and cross-validate, fine-tune with grid and randomized search, evaluate, then launch, monitor and maintain.

  2. 02

    Classical models

    Chapters 3 to 9

    Classification on MNIST with precision, recall and the ROC curve, and error analysis; training models (the normal equation, gradient descent, regularized linear models, logistic and softmax regression); support vector machines; decision trees; ensembles (voting, bagging, random forests, boosting, stacking); dimensionality reduction (PCA, manifold learning); and unsupervised learning (k-means, DBSCAN, Gaussian mixtures, anomaly detection).

  3. 03

    Neural networks with Keras

    Chapters 10 and 11

    Chapter 10 introduces neural networks: the perceptron, the multilayer perceptron and backpropagation, then the Keras Sequential, Functional and subclassing APIs, callbacks, TensorBoard and hyperparameter tuning. Chapter 11 is about training deep networks: vanishing and exploding gradients, initialization, activations, batch normalization, transfer learning, faster optimizers up to Adam and AdamW, learning rate scheduling and regularization.

  4. 04

    TensorFlow in depth and applied deep learning

    Chapters 12 to 17

    Custom models and training loops with TensorFlow, loading and preprocessing data, convolutional networks for vision, sequence processing with RNNs and CNNs, natural language processing with RNNs and attention, and autoencoders, GANs and diffusion models.

  5. 05

    Reinforcement learning and deployment

    Chapters 18 and 19

    An introduction to reinforcement learning, and training and deploying TensorFlow models at scale.

Concepts worth keeping

Train, validation and test splits

Chapter 1 and 2 stress keeping a test set untouched and using validation to choose models. Data mismatch, where training and production data differ, is named as its own problem.

Transformation pipelines

Chapter 2 builds data cleaning, encoding and scaling into pipelines so the same steps run in training and in production.

Precision and recall trade-off

Chapter 3 shows why accuracy misleads on skewed classes and how to choose a threshold on the precision/recall curve.

Bias, variance and regularization

Chapter 4 uses learning curves and regularized linear models (ridge, lasso, elastic net) and early stopping to show underfitting and overfitting directly.

Ensembles

Chapter 7 combines many weak or diverse models, via voting, bagging, boosting and stacking, to beat any single one.

Transfer learning

Chapter 11 reuses pretrained layers so a small dataset can train a strong model.

What the author concludes

The book's argument is practical: most of the difference between a demo and a working system is in the data, the evaluation and the maintenance, and the algorithms are tools for that. It ends by covering deployment of models at scale, so the reader finishes with a model that serves traffic.

Limits to keep in mind

  • Its deep learning code is built on TensorFlow and Keras. The publisher page for the 3rd edition (October 2022) predates the current wave of large language models and does not treat them as a topic.
  • It is broad. Each algorithm gets enough depth to use it, not the derivations found in Bishop or Goodfellow.
  • Reinforcement learning gets one chapter, and Sutton and Barto remains the reference for that subject.

What I take into AI engineering work

  • Copy the Chapter 2 workflow for every project: frame the problem, choose a metric, hold out a test set, build a pipeline, then iterate.
  • Always start with a simple baseline from the classical chapters before reaching for a neural network.
  • Use error analysis (Chapter 3) to decide what to fix next instead of tuning blindly.
  • Plan monitoring and retraining from the start, as the last section of Chapter 2 asks.

Sources

My note

What the book gets right is the order of work: a simple baseline and a clean split first, then anything more complex. Pipelines are used to keep preprocessing repeatable and to stop leakage between train and test data. It also asks you to look at the errors a model makes before deciding how to improve it, and the same workflow carries from tabular models to deep networks.

Next bookDeep Learning with Python