Chapter 2: When should I use Machine Learning?

In the previous chapter, we’ve shown that every machine learning program could, in theory, be written as an explicit program. Which begs the question: “When should I use Machine Learning?”. Indeed, as we’ve also shown, writing the learning aspect of a machine learning problem might require more code than if you explicitly wrote your program. So how can one identify situations where it might be beneficial to use machine learning?

The solution is simple but large and difficult to maintain

Though some problems are small and simple enough to be tackled explicitly by a human, many tasks quickly become too complicated or large to handle. In the spam filter example, it might be feasible for someone to create a fairly good spam filter for themselves. But what if we asked them to create spam filters for thousands of other people? They could try to build one spam filter for everyone, but it might quickly run into issues as everyone’s definition of what a spam is might vary.  So, they would have to understand what everyone considers as a spam and then, they would have to write slightly different pieces of code for everyone. This very quickly becomes unfeasible and cumbersome.


The solution is too complex to write explicitly

In the spam filter example, the solution is simple enough that a human could explicitly write it, but it is the sheer amount of different solutions that are required which makes machine learning a useful alternative. However, there also exists cases where a solution might even too complicated for a human to come up with. Let’s take the example of facial recognition. In this example, a computer reads in a picture and decides whether or not the photo is of a specific person. First of all, if you had to write on a sheet of paper how to differentiate your face from other people, you’ll realize how complex of a task it is. Second, to 
a computer, a picture is nothing but a matrix of pixels.  So regardless of how long a human tries, they would not be able to come up with an explicit program solving the problem.

Computers can process information much faster than humans can, meaning that they are not only able to come up with more solutions, they are also able to come up with more complex ones. And for many problems, they have shown to come up with better solutions than humans!

Human performance is not good enough

In other cases, it might be possible for humans to come up with an explicitly written program to solve a problem. And it might also be feasible to maintain it. Often, this happens when domain experts get involved. However, in many cases, a human solution might not be good enough for a problem. And because machine learning can come up with more solutions that are also more complex, it might be able to do even better than humans.


There are more and more examples of machine learning programs outperforming humans, shall it in law, medicine, or even board games! These examples confirm that in many cases, human performance doesn’t mean that it is perfect. It also shows that often, humans are biased and less creative when it comes to finding potential solutions.