Why Most Machine Learning Books Suck

Good teaching is work. Great teaching is a lot of work. Mediocre teaching is no work at all.

Addison Sears-Collins (2019)

Yes, the title is provocative, but somebody had to say it. Here is a quick list why most machine learning books are a waste of time. I’ll get into each point later in this post.

  • Subscript and Superscript Soup
  • Too Much Focus on Irrelevant Minutiae
  • Teaching to the Tools Instead of the Problem
  • No Common Language
  • Author Has No Training on How to Teach
  • Using Words Like “Basically”, “Simple”, and “Easy”
  • Show Me Don’t Tell Me
  • Here is What Well Written Textbooks Look Like

Most of the “introductory” machine learning books (textbooks, especially) suck. While the subject matter in these books is supposed to be introductory, the way in which concepts are explained is not introductory at all. Simple concepts are often explained with such complex jargon and mathematical symbol soup that the underlying ideas get totally lost.

If you want to see mental masturbation at its finest, just pick up any of the popular machine learning textbooks used in machine learning courses at colleges and universities around the world.

So many of these machine learning textbooks spend pages and pages explaining machine learning without actually doing machine learning with step-by-step fully worked real-world examples (I presume because the publisher wants to limit the page count). It is kind of like learning how to play tennis by having someone explain to you how to play tennis vs. getting out there on the court and actually playing!

While reading these books, I always find myself asking these questions:

  • Why write an introductory book if the explanations are so convoluted that only an expert can understand? 
  • Why ask end-of-chapter questions and provide no answer key? 
  • Why provide no step-by-step practice with real-world examples?

Feedback and deliberate practice is a critical part of building confidence as you learn a new skill. Most of the “introduction” to machine learning books lose sight of this concept. Authors need to realize that you need to start with teeny tiny baby steps when you are writing for beginners.

Subscript and Superscript Soup

Take a look at this excerpt from a popular Introduction to Machine Learning textbook where the author attempts to explain logistic regression.

Source: Introduction to Machine Learning


This example hits on one of my biggest annoyances about machine learning books. The algorithms and mathematical equations contain so many variables, subscripts, and superscripts that you need to make a glossary on a separate sheet of paper just to keep track of it all because it would be utterly impossible to retain everything in your head while trying to decipher the points the author is trying to make. This kind of practice gets in the way of learning as well as your ability to see the big picture. 

Most of these “introduction” to machine learning books are written for people who already have a deep expertise in the subject. The subscript and superscript soup present in these books are as understandable to me as Ancient Greek. 


Too Much Focus on Irrelevant Minutiae

Take a look at this page taken from another popular Machine Learning book where the author introduces the K-Means clustering algorithm.

What the heck is this guy talking about? I had to double check the preface to see if this book was written for beginners or experts (i.e. it was written for beginners). To the average undergrad who wants to go out and get a job applying machine learning to real-world problems, how important is it to know all these mathematical details upfront? 

Answer: Not very important. Rarely will you ever need to know these details, and if you do, just look them up. Most textbooks focus way too much on the minutiae (as if they are writing an academic research paper) and not enough on how to apply this knowledge to solve real-world problems.

At no point do these authors convey:

  • Why does knowing this matter? 
  • What value does knowing this have on a real-world application as well as my ability to get and retain a job in this field. Most beginners don’t want to go on to get PhDs and do research. Some do, but most of the readers do not.

Teaching to the Tools Instead of the Problem

Machine learning textbooks need to teach to the problem, not to the tools and the underlying mathematics. They need to first tell you why something is important. The easiest way to do this is to explain a concept by starting with a real-world problem

Most textbooks, instead, do it the other way around. They teach you the intricate details of the tool in isolation, teach you some proof, and then (in rare cases), apply the concept to a problem (a problem which almost never resembles the types of problems you would face in the real world at a job).

Authors need to show readers how machine learning fits into the big picture (i.e. the other tools a beginner might already be familiar with, like statistics or data analysis). At the end of the day, machine learning is just a tool. It is not a panacea. 

It is just a tool, just like the World Wide Web is a tool…just like a programming language like Python is a tool…or just like Microsoft Excel is a tool. 

Machine Learning is to an engineer what a wrench is to a mechanic. A mechanic does not need to know how to build a wrench in order to use it. He just needs to know how to use it to solve a problem. The vast majority of people will not need to know the underlying proofs and mathematics at such a detailed level in order to succeed in the workplace (unless you become a researcher, in that case, you will be trying to build a better wrench).

Machine Learning is a tool in the toolbox

Machine learning textbooks need to start with a real-world problem, then work through that problem, set-by-step, and explain the mathematics on an as-needed basis, not just throw it on the page for the sake of pretending to be mathematically rigorous.

If you decide to deep dive into research later on in your career, THEN pick up the mathematics on an as-needed basis. 

I don’t need to know how an internal combustion engine is built to be an awesome driver, and most companies will hire you based on your problem-solving ability, not on your ability to write proofs of off-the-shelf algorithms…so problem solving is what books need to focus on.

No Common Language

It does not help that there is no common language in machine learning. There are sometimes a dozen different ways to say the same thing (feature, attribute, predictor, x-variables, independent variables, etc.) or (target, class, response variable, y-variable, hypothesis). These multiple ways of saying the same thing make it totally confusing for a beginner, and rarely do authors point out the fact that there are a myriad of ways of saying the same thing.

Author Has No Training on How to Teach


Many of these authors are accustomed to writing for an expert audience (via academic research papers) and have not properly developed the skill of breaking down complex subject matter into easy-to-understand, digestible bite-sized pieces that would be understandable by a competent beginner. 

Elementary and high school teachers must get a degree or diploma in teaching. They have to endure hundreds of hours of instruction on how to teach and how to deal with different learning styles. Most machine learning textbook authors have not had this training. 

I find that the best teachers of a subject are often students who are one step removed from having learned the subject. It is fresh in their minds, and they still remember what it is like to be a beginner.

Using Words Like “Basically”, “Simple”, and “Easy”

A favorite of machine learning textbook authors it to make the assumption that the reader already understands a “simple” concept that’s necessary to understand the new topic. This is frustrating for someone new.

So many of these textbooks use terms like “simple,” “straightforward,” “easy,” “obvious,” and “basically,” which hurts a beginner’s confidence if he is not easily able to grasp the material. This is a huge pet peeve of mine. Words like these have no place in a book claiming to be an “introduction.” 

You’re trying to climb the machine learning mountain. The author is already at the top of the mountain. The author forgot how hard the struggle was to get to the top. The author forgot what it is like to even take the first step because it has been so long. It all seems easy after you’ve been there, done that. 

It would be like Michael Jordan teaching someone how to play basketball. Some things are so intuitive and second nature to him that, although he is the best basketball player that ever lived, he might not be the best one to teach it because he is so far removed from what it was like as a beginner, learning the basics, when even the smallest steps are difficult and not second nature. 

Similarly, you might know how to ride a bicycle really well. However, try to teach someone else how to ride a bicycle. You will notice that teaching someone how to ride a bike is different from being a really good bike rider. In order to teach someone how to ride a bike, you have to take what you know and break it down into teeny tiny parts. The ability to do this well is a skill in and of itself…one that takes time and practice to get good at.


When you learn something, and especially if it is something you’ve spent decades immersed in, it’s intuition to you. Most machine learning books are especially bad about this. They just assume that you understand exactly what is going on. They do not explain. It was just “if this, then that.” They speak in generalities and hand-wavy language when the beginner needs step-by-step detail. They use machine learning and math to explain machine learning and math.

They do not realize that in order to teach someone something, it is best to tie the new concept to a concept that the beginner might already be familiar with.

Again, the best teachers in my experience are those that are one step removed from learning a subject as they have the knowledge fresh in their mind and remember clearly what it is like to be a beginner.

Show Me Don’t Tell Me

Authors need to stop introducing a new concept by explaining it. Instead, they need to use the following teaching aids:

  • Analogies: Connect the current knowledge to previous knowledge that most beginners would have.
  • Pictures and Diagrams: Draw a picture to help me visualize the concept.
  • Real-world Examples: Why does this concept matter? Show me a real-world example of this concept in practice, solving an actual problem. Tell me a story.
  • Layman’s Terms: Explain a term in basic plain language. Act as if you are explaining a concept to a five-year-old child.

Here is What Well Written Textbooks Look Like

Here is what a well written textbooks for beginners should look like. Consider these textbooks among the GOATs (i.e. greatest of all time) of textbooks:

The books above are an absolute joy to learn from. They will make you rethink the way introductory textbooks should be written. 

For you “Introduction” to machine learning authors out there, take note.

Further Reading

I encourage you to check out Jason Brownlee’s Post, “Why Machine Learning Does Not Have to Be So Hard”, where he calls out universities and traditional courses for teaching machine learning incorrectly. He also outlines a rough process for getting started.

Also, check out the first response in this post about how to learn difficult subjects.

Mastering Turtlesim in ROS 2 Foxy Fitzroy

In this post, we will learn the basics of ROS 2 by working with Turtlesim, a ROS 2-based simulator. Follow each step below, one line at a time. Take your time, so you do everything correctly. There is no hurry.

The official tutorial is located in the ROS 2 Foxy documentation, but we’ll run through the entire process step-by-step below.

You Will Need

In order to complete this tutorial, you will need:


It is helpful if you’ve completed this tutorial on Linux fundamentals, but it is not required.

Install Turtlesim

Install Turtlesim, by typing the following commands:

sudo apt update
sudo apt install ros-foxy-turtlesim

Check that Turtlesim was installed.

ros2 pkg executables turtlesim

Here is what you should see:


Launch Turtlesim

To launch Turtlesim, type:

ros2 run turtlesim turtlesim_node

Here is the window that you should see:


In the terminal, you will see the position and orientation of the turtle.


Let’s move the turtle around the blue screen.

ros2 run turtlesim turtle_teleop_key

With this same terminal window selected, use the arrow keys to navigate the turtle around the screen.

To close turtlesim, go to all terminal windows and type:


Common ROS 2 Commands

Open a new terminal. Let’s type some common ROS 2 commands.

To list the active ROS nodes, type the following command. A node in ROS is just a program (e.g. typically a piece of source code made in C++ or Python) that does some computation. 

ros2 node list

Robots require a number of programs to work together to achieve a task. You can think of a node as a small single-purpose program within a larger robotic system. 

One way nodes communicate with each other is by using messages. These messages are passed via channels called topics.

To see a list of active topics in ROS 2, type the following command:

ros2 topic list

Don’t worry what all those topics mean. In a later post, I’ll dive deeper into ROS topics.

Let’s see what the active services are. A ROS Service consists of a pair of messages: one for the request and one for the reply. A service-providing ROS node (i.e. Service Server) offers a service (e.g. read sensor data). 

ros2 service list

Let’s see what actions are active now. I explain the difference between a ROS Action and a ROS Service in this post.

ros2 action list

Here is one more command you should know:

  • ros2 node info <node_name> : Shows information about the node named node_name.

Install rqt

Let’s install rqt. rqt is a tool that enables you to see the connections between nodes.

sudo apt update
sudo apt install ~nros-foxy-rqt*

Press Y and Enter to complete the installation.

Run rqt

Launch turtlesim again.

ros2 run turtlesim turtlesim_node

In another terminal tab, type:

ros2 run turtlesim turtle_teleop_key

To run rqt, open a terminal window and type:


If this is your first time running rqt, go to Plugins > Services > Service Caller in the menu bar at the top.

Here is what my window looks like:


Click the refresh button to the left of the Service dropdown menu. This button looks like this:


Here is what my window looks like now:


Click the dropdown list in the middle of the window, and select the /spawn service.


Launch Another Turtle Using the Spawn Service

The /spawn service spawns another turtle. Let’s use this service now.

Set the values under the Request area to the following by double-clicking the values under the ‘Expression’ menu.

In this case, we want to launch a new turtle at coordinate x=1.0, y=1.0. The name of this new turtle will be turtle2.

Call this service by clicking the Call button in the upper right of the panel.


You should see a new turtle spawned at coordinate x=1.0, y=1.0.


Click the Refresh button.

You now have new services for turtle2.


Using the Set Pen Service

Let’s change the color of the pen for the first turtle, turtle1.

Go to the Service dropdown list, and scroll down to /turtle1/set_pen.


We want turtle1’s pen to be green, so we set the g (Green) color value to 255. I also want the width of the pen to be 5.

Click Call to call the service.

If you go to the terminal and select the terminal where you typed the “ros2 run turtlesim turtle_teleop_key” command, you can move turtle1 around the screen with your keyboard. You will see a green pen color.


Move turtle2

Let’s move turtle2. To do that, we need to perform remapping. We need to remap the velocity command for turtle1 to turtle2. Open a new terminal tab, and type (this is all a single command):

ros2 run turtlesim turtle_teleop_key --ros-args --remap turtle1/cmd_vel:=turtle2/cmd_vel

You can use your keyboard to move turtle2 around the screen.


To close turtlesim, go to all terminals and type:


How to Install ROS 2 Foxy Fitzroy on Ubuntu Linux

In this post, we will install ROS 2 Foxy Fitzroy. As of the date of this tutorial, ROS 2 Foxy Fitzroy is the latest ROS distribution that has long term support. It will be supported until May 2023.

You Will Need

In order to complete this tutorial, you will need:
Ubuntu 20.04 installed and running properly (I’m running my Ubuntu in a VirtualBox on Windows 10).


It is helpful if you’ve completed this tutorial on Linux fundamentals, but it is not required.

Set the Locale

The official steps for installing ROS are at this link at ROS.org, but I will walk you through the process below so that you can see what each step should look like.

The first thing we are going to do is to set the locale. You can understand what locale means at this link.  

Type this command inside the terminal window.


Now type the following command.

sudo apt update && sudo apt install locales

If you get some error that looks like this: “Waiting for cache lock: Could not get lock /var/lib/dpkg/lock. It is held by process 3944”, open a new terminal window, and kill that process:

sudo kill -9 [process ID]

In my case, I type:

sudo kill -9 3944

Wait for everything to install, and then type:

sudo locale-gen en_US en_US.UTF-8
sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8

Add the ROS 2 Repositories

Type the following inside the terminal.

sudo apt update && sudo apt install curl gnupg2 lsb-release

At the prompt, type Y and then Enter to install the repositories.

Now type the following command (this is a single command. you can copy and paste all this into your terminal window):

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

Now let’s add the repository to the source list.

sudo sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'

Install the ROS 2 Packages

Update the apt repository cache.

sudo apt update

Install the Desktop version of ROS 2.

sudo apt install ros-foxy-desktop

Type Y and Enter to download ROS 2.

Set up the Environment Variables

Add foxy to your bash file.

echo "source /opt/ros/foxy/setup.bash" >> ~/.bashrc

To check if it was added, type the following command, and scroll all the way to the bottom.:

gedit ~/.bashrc

If you don’t have gedit installed, type:

sudo apt-get install gedit

Now close the current terminal window, and open a new one.

Type the following command to see what version of ROS you are using.

printenv ROS_DISTRO

Here is what you should see.


You can also type:

env |grep ROS

Install some other tools that you will work with in ROS. After you type the command below, press Y and Enter to complete the download process.

sudo apt install -y python3-pip
pip3 install -U argcomplete

Test Your Installation

Open a new terminal window, and launch the talker program. This program is a demo program written in C++ that is publishing messages (i.e. data in the form of a string) to a topic. 

ros2 run demo_nodes_cpp talker

Then type the following command in another terminal window to launch the listener program. This Python program listens (i.e. subscribes) to the topic that the talker program is publishing messages to. 

ros2 run demo_nodes_py listener

To understand how topics, publisher nodes, and subscriber nodes work in ROS, check out this post.

If you saw the output above, everything is working properly. Yay!

That’s it!