Hands-On Machine Learning, 2nd vs 3rd edition: which one?

As an Amazon Associate I earn from qualifying purchases.

広告 / Ad: this article contains affiliate links (Amazon Associates and Rakuten Affiliate) near the end.

Key points

What the edition choice actually is

Choose the third edition if you are starting without a requirement to follow the second: the author's second-edition repository labels that edition outdated and points to the third-edition companion. Choose the second edition when your goal is specifically to follow its examples and exercise solutions, which the author identifies as belonging to that edition.

The practical distinction is the relationship between the book and its code. handson-ml3 is the author's repository of example code and exercise solutions for the third edition of Hands-on Machine Learning with Scikit-Learn, Keras and TensorFlow. The corresponding second-edition repository is handson-ml2.

Both repositories describe a project intended to teach the fundamentals of machine learning in Python. The third-edition repository's description also names deep learning, Scikit-Learn, Keras, and TensorFlow 2. These are companion projects with instructions for viewing notebooks, running them online, and installing them locally.

For a developer choosing between editions, that makes the repository an immediate part of the decision. Selecting an edition also identifies which example collection and installation instructions to follow. The author makes that connection explicit in each README, with links directing readers to the repositories for other editions.

Sources: second-edition repository and third-edition repository, retrieved 2026-10-29.

What the author's pages say

The clearest statement about the older option appears at the top of the second-edition README:

⚠ THIS EDITION IS NOW OUTDATED. THE THIRD EDITION OF MY BOOK IS NOW AVAILABLE, AS WELL A PYTORCH VERSION AND MANY TRANSLATIONS .

Source: second-edition README, retrieved 2026-10-29.

That is the author's stated status for the second edition. Its repository description also carries a deprecation notice and points readers toward other repositories, including handson-ml3. Within this second-versus-third choice, the direction is explicit.

The third-edition README identifies its contents as the example code and exercise solutions for the third edition of the O'Reilly book. Its FAQ gives a concrete environment recommendation:

I recommend Python 3.10.

Source: third-edition README, retrieved 2026-10-29.

The second-edition FAQ recommends Python 3.8. It explains that some libraries do not yet support Python 3.9 or 3.10 in the context of those instructions. The third-edition FAQ says that following its installation instructions provides Python 3.10 and that any version ≥3.7 should also work. These are the recommendations recorded on the respective pages.

The online instructions differ too. The second-edition page recommends Colab or Kaggle and says they offer free GPUs and TPUs. The third-edition page recommends Colab, while saying that other services have not been fully tested by the author.

Both pages warn about temporary online environments and tell readers to download data they care about. That warning belongs alongside the convenience of trying the notebooks without a local installation: preserving work is part of the workflow described by the author.

Sources: second-edition instructions and third-edition instructions, retrieved 2026-10-29.

Comparing the repositories and setup commands

The repository listings provide a concrete comparison of the companion materials.

Edition Companion repository Recommended Python Conda environment Autoencoders notebook filename
Second edition handson-ml2 Python 3.8 tf2 17_autoencoders_and_gans.ipynb
Third edition handson-ml3 Python 3.10 homl3 17_autoencoders_gans_and_diffusion_models.ipynb

Sources: second-edition files and README and third-edition files and README, retrieved 2026-10-29.

The listings share notebook filenames covering classification, training linear models, support vector machines, decision trees, ensemble learning and random forests, dimensionality reduction, and unsupervised learning. Both also list notebooks for neural networks with Keras, custom models and training with TensorFlow, loading and preprocessing data, reinforcement learning, and training and deploying at scale.

The autoencoders filename provides a visible difference: the third-edition listing explicitly adds diffusion models. Another difference is that the third-edition listing includes extra_ann_architectures.ipynb. Both listings contain supporting notebooks for differential calculus, linear algebra, Matplotlib, NumPy, and pandas, along with a machine learning project checklist.

The local installation instructions share a structure. They begin with Anaconda or Miniconda and Git. For a TensorFlow-compatible GPU, they also direct readers to install the GPU driver and appropriate CUDA and cuDNN versions.

Here are the third-edition repository's clone and environment commands, reproduced verbatim:

$ git clone https://github.com/ageron/handson-ml3.git
$ cd handson-ml3
$ conda env create -f environment.yml
$ conda activate homl3
$ python -m ipykernel install --user --name=python3

The page then starts Jupyter with:

$ jupyter notebook

Source: third-edition installation instructions, retrieved 2026-10-29.

The README explains that the leading dollar signs indicate terminal commands and should not be typed. The second-edition instructions follow the same sequence but clone handson-ml2, enter that directory, and activate tf2.

For readers following a book alongside executable examples, the repository directory and environment name are useful checkpoints. They let you identify which edition's setup instructions you are following before opening the notebooks.

Which edition fits your goal?

For a new start within this choice, pick Hands-on Machine Learning with Scikit-Learn, Keras and TensorFlow, third edition. The recommendation follows the author's explicit notice on the older repository and the third-edition README's identification of its companion code.

If your goal is to work specifically with the second edition's examples and exercise solutions, pick Hands-on Machine Learning with Scikit-Learn, Keras and TensorFlow, second edition. Its repository explicitly says those are the materials it contains. That is a concrete reason to choose it when edition matching is your priority.

If you already have the second edition, begin by identifying what you want from a change. The third-edition repository gives you observable comparison points: its Python recommendation, its named Conda environment, and the diffusion-models notebook filename. Those are useful details to inspect against your intended work.

You can also inspect the notebooks before committing to a local setup. Both READMEs describe ways to look at notebooks without executing code, as well as ways to run them online. Both caution that GitHub's notebook viewer is slower, does not always display mathematical equations correctly, and often fails to open large notebooks. That gives readers a documented reason to consider the other viewing routes described on the repository pages.

Sources: second-edition README and third-edition README, retrieved 2026-10-29.

What these pages do not tell you

These repository pages do not establish that either book's full text is free to read online. They identify example code and exercise solutions, so access to the companion notebooks should not be treated as access to the complete book.

The file listings also do not provide a complete account of revisions between editions. Shared filenames do not establish identical notebook contents, and the diffusion-models filename does not establish the depth of that treatment. The listed change documents were not part of the retrieved page text, so their contents cannot support a more detailed revision comparison here.

Neither page establishes which edition explains a subject more clearly, how long it takes to complete, or whether replacing an existing copy is worthwhile for a particular reader. Those judgments require evidence beyond repository descriptions and setup instructions.

Finally, the installation sections are instructions, not a recorded execution test. They do not demonstrate that either environment installs successfully on your particular machine or that every notebook runs without modification. The supported buying distinction remains specific: the author marks the second edition outdated, while maintaining an explicit mapping between each edition and its own companion examples.

Japanese editions on Rakuten Books

広告(楽天アフィリエイト) / Ad (Rakuten Affiliate): the link(s) below go to Rakuten Books Japan and earn the site operator a commission if you buy through them. Prices are not shown here because they change; check the product page.

TechAthletes takes part in the Rakuten Affiliate program (楽天アフィリエイト) and earns a commission on purchases made through these links.

Comments

Copied title and URL