This post is part of “AI education”, a series of posts that review and explore educational content on data science and machine learning. (In partnership with Paperspace)
With so many books and online courses on data science and machine learning, it’s very hard to navigate your way and find the best resource to take the next step in honing your artificial intelligence skills. Previous installments in this series explored introductory material on data science and machine learning.
In this post, I will look at Python Machine Learning, Third Edition by Packt, an excellent resource for developers who already have basic knowledge of ML and data science.
Bring your math and programming skills
Off the bat, Python Machine Learning is not for amateurs. The authors assume you have a solid command of Python. The book uses some of the advanced list and collection functions. There’s also (thankfully) a fair bit of object-oriented programming techniques that enable you to use reusable components for your machine learning programs.
You’ll also need to have a basic knowledge of data science libraries such as NumPy, Pandas, and Matplotlib, though the book goes into a lot more detail about their functionality.
Unless you have a fair understanding of the basics of data science, calculus, and statistics, you’ll find Python Machine Learning a bit complicated and confusing. The math is much more involved than introductory books. You’ll find a lot of calculus formulas for loss functions, regularization functions, perceptrons, neural networks, and more.
But the authors of Python Machine Learning do a great job of explaining those formulas through examples and step-by-step coding experiences. These examples make the content accessible to a wider audience and set the book apart from textbooks written for an academic audience.
There are also plenty of references to relevant papers that provide in-depth explanations of different machine learning and deep learning concepts, which is great if you want to further expand on the knowledge you learn in Python Machine Learning.
Some object-oriented love for machine learning
Most machine learning and data science books focus on writing structured code and rely on copying and pasting codes across examples. Python Machine Learning, on the other hand, introduces object-oriented concepts to create neat and reusable code, which I really enjoyed.
Granted, the introduction of OOP makes the book a bit more complicated for developers who are not familiar with concepts such as inheritance, abstraction, and polymorphism. But chances are, you’ll need OOP skills down the road if you want to have a successful career in building machine learning apps.
Python Machine Learning also provides a great hierarchical breakdown of sklearn. This will help you better understand and leverage the functionalities of one of the Python libraries you’ll use very often in machine learning projects.
The DIY approach to machine learning
One of the things that was really appealing about Python Machine Learning was the do-it-yourself approach to some of the fundamental components of machine learning libraries. You get to create your own perceptron class from scratch, which gives you a very solid idea of how neural networks operate. You will later build up on the components of the perceptron to understand other neural network concepts such as stochastic gradient descent (SGD), backpropagation, and convolutions. I’ve seen several books and courses that explain the workings of neural networks, but this is the most comprehensive and hands-on text I’ve seen so far.
You also get to recreate some of the fundamental machine learning algorithms such as principal component analysis (PCA), which help you better grasp the effect of each of the hyperparameters of the algorithm.
The custom algorithms you build along the book are not very efficient and are meant for educational purposes only. The authors of Python Machine Learning then introduce the equivalents of those algorithms in Scikit-learn and TensorFlow.
Another great feature you’ll find in Python Machine Learning is a chapter that takes you through the integration of machine learning algorithms into real-world applications. You’ll get to create a web application that is powered by a machine learning algorithm in the backend. The application is crude, to be fair, but the point is to show how these different pieces come together, and the authors have done a great job at that.
A rich set of machine learning and deep learning algorithms
One of the things I take into account when evaluating machine learning books is the roster of algorithms you get to explore. In this regard, Python Machine Learning doesn’t disappoint. It takes you through the basic supervised and unsupervised machine learning algorithms such as linear and logistic regression, support vector machines, decision trees and random forests, and k-means clustering. To that it adds some of the less-discussed algorithms such as agglomerative clustering and DBSCAN.
A lot of this might overlap with what you’ve already read in introductory books on data science and machine learning, but the added depth that Python Machine Learning brings to each topic is very welcome.
Python Machine Learning will also take you through some of the algorithms and functionalities that you don’t find in introductory books, such as visualizing correlations between different dataset features with mlextend or doing a thorough evaluation of your regression models.
The deep learning section of the book provides a lot of useful theoretical material and hands-on experience on different types of neural networks. You’ll get to use fully connected, recurrent, and convolutional neural networks with TensorFlow and Keras. The book contains a full section that intuitively explains the logic behind TensorFlow components, a topic that is usually difficult to wrap your head around.
Like the rest of the book, the deep learning section is example-driven. By the end of the book, you’ll get to visit some advanced structures such as transformers and generative adversarial networks. There’s also an introductory chapter on reinforcement learning, where you’ll get to use the popular OpenAI Gym library.
The one thing that came as a bit of disappointment was the RNN section on natural language processing, in which the example code ended abruptly, and there was no section on testing the model.
True to its previous editions, Python Machine Learning, Third Edition is an excellent book for developers who are already versed in the basics of machine learning and data science. It won’t turn you into a machine learning and deep learning guru ready for a six-digit salary, but it will certainly lay the foundations for more advanced exploration of machine learning.
What’s the next step? Depending on your area of interest, I would suggest picking up a book or course dedicated to computer vision, natural language processing, or reinforcement learning. I’ll provide some recommendations in future posts.