rasbt/python-machine-learning-book: What the 1st Edition Notebooks Actually Contain
The "Python Machine Learning (1st edition)" book code repository and info resource
At a glance
- What is it?
- This repository holds the chapter notebooks for the 1st edition of Python Machine Learning, published September 2015. It is a companion to a printed book, not a standalone library, and the README says so directly.
- Who is it for?
- Adopt this repository only if you already own or are working through the 1st edition of the book, or if you want its Theano-based chapter 13 as a historical reference. Do not adopt it as a current scikit-learn tutorial; the README itself points readers to the 2nd edition repository, and the last tagged release here is v1.3 from September 2016.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 59 days ago.
- What is it written in?
- Mainly Jupyter Notebook, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What this repository is, and what it is not
This is the code companion to the 1st edition of Python Machine Learning, published by Packt on September 23rd 2015, 454 pages, ISBN-13 978-1783555130. The repository description calls it a code repository and info resource. The README is blunt about the distinction: the notebooks "may not be useful without the formulae and descriptive text." That sentence should decide most adoption questions on its own. If you do not have the book, you are looking at thirteen notebooks of executable fragments whose explanatory prose lives somewhere else. The author also states the intent behind the book: it is not "just another 'this is how scikit-learn works' book," and the code puts concepts into action mainly using NumPy, scikit-learn, and Theano. The audience is a reader learning machine learning from theory through implementation, not a team looking for a library to import.
The thirteen notebooks and the ground they cover
The table of contents maps one notebook per chapter, each with a directory under code/ and an .ipynb file. Chapter 2 covers training algorithms for classification, chapter 3 tours scikit-learn classifiers, chapter 4 is data pre-processing, chapter 5 dimensionality reduction, chapter 6 model evaluation and hyperparameter optimization, chapter 7 ensembles, chapter 8 sentiment analysis, chapter 9 embedding a model in a web application, chapter 10 regression, chapter 11 clustering, chapter 12 neural networks for image recognition, and chapter 13 parallelizing neural network training via Theano. Each chapter row also links an nbviewer URL, and the README notes that the internal document links are only supported by the nbviewer version. That detail matters if you clone and click around inside the rendered Markdown: cross-references between chapters will not resolve locally the way they do on nbviewer. The spread is broad rather than deep in any one area, which is what a single-volume introductory text implies.
Running the notebooks: the setup path the README points to
There is no package to install. The README links a setup guide at code/ch01/README.md, titled instructions for setting up Python and the Jupyter Notebook, and that file is where the actual environment steps live. Beyond that pointer, the repository gives you directories and notebooks, not a requirements.txt, not a pyproject.toml, not a conda environment file. You supply the interpreter and the libraries. The README names NumPy, scikit-learn, and Theano as the main tools used across the chapters, so those three are the dependencies to plan for. Note the spelling in the README: Jupyter is written as "Jupiter" in the chapter 1 setup link text. That is cosmetic, but it is a small signal about how much editorial maintenance this 1st edition repository receives. Practically, you clone the repository, open a chapter directory, and launch the notebook from there so relative paths to any local data resolve.
The Theano chapter is the part most likely to break
Chapter 13 is titled Parallelizing Neural Network Training via Theano. Theano is the one dependency in this stack that has been effectively retired upstream, and the repository carries no pinned version for it. Nothing in the supplied material states that chapter 13 has been updated, and the last release tag is v1.3 from September 30th 2016, with v1.2 in March 2016 and v1.0 in October 2015. A notebook written against Theano in that era is the first thing to test before committing to this repository for neural network material. The same caution applies more mildly to the scikit-learn chapters: chapter 3 is a tour of classifiers, chapter 6 covers model evaluation and hyperparameter optimization, and both APIs have moved since 2015. Deprecation warnings are the likely outcome, but renames in estimator parameters are the kind of change that stops a cell rather than warning about it. Verify chapter by chapter rather than assuming the whole set runs.
Licence scope: MIT on the repository, not on the book
The repository is MIT licensed. That covers the code in the notebooks and the scripts in the chapter directories. It does not cover the book text, the figures reproduced from the book, or the PDFs in docs/, such as the foreword, the preface, and the equation reference at docs/equations/pymle-equations.pdf with its LaTeX source. The cover image and the Computing Reviews badge image under images/ are third-party marks. If you want to reuse a notebook cell in your own project, the MIT grant is the relevant permission and the usual attribution practice applies. If you want to reuse a figure or a passage of explanation, the MIT file does not speak to that, and you would need to look at the publisher's terms. This is a description of what the licence file covers, not legal advice; read the LICENSE and the publisher's terms yourself before republishing anything beyond code.
Maintenance cost and the 2nd edition fork in the road
The README carries a dated notice, 09/21/2017, stating that this repository contains the 1st edition examples and directing readers to rasbt/python-machine-learning-book-2nd-edition for the 2nd edition code. That notice is the single most useful maintenance fact here. The project is not archived, and the last push timestamp is recent, but the release history stops in 2016 and the content is tied to a 2015 print edition. So the maintenance question is not whether the repository is abandoned; it is whether you are on the 1st edition or the 2nd. If you are on the 2nd edition, you are in the wrong repository and the README says so. If you are on the 1st edition, the repository is stable in the sense that a book's code does not need to change, and stale in the sense that its dependencies have. There is also a reader discussion board linked at the top of the README, a Google Group, which is where errata and reader questions were routed.
Where a maintained alternative fits, and where this one still wins
The obvious alternative is the 2nd edition repository, and the difference is not cosmetic. The README links a page titled what's new in the second edition from the first edition, which implies a documented delta in content and code. If your goal is to learn current scikit-learn practice, the 2nd edition repository is the one the author points to, and it is the one whose examples track a later library surface. This repository still has a reason to exist for two groups. Readers holding the 1st edition paperback need the notebooks that match their page numbers and chapter structure, and no other repository does that. And anyone studying how neural network tooling was taught before the current frameworks settled will find chapter 13 useful precisely because it is Theano-based. For a beginner with no book in hand, this is the wrong entry point: the README's own warning about missing formulae applies most sharply to exactly that reader.
Editorial conclusion
Adopt this repository only if you already own or are working through the 1st edition of the book, or if you want its Theano-based chapter 13 as a historical reference. Do not adopt it as a current scikit-learn tutorial; the README itself points readers to the 2nd edition repository, and the last tagged release here is v1.3 from September 2016. Before cloning, open code/ch01/README.md and confirm the Python and Jupyter setup steps still match your environment, then check whether the Theano code in ch13 runs at all under a current interpreter.
Community notes