Chapter 1
How Machine Learning Works

Software developers like to share war stories. As soon as a few of us sit down in a pub, somebody asks: “What project are you working on?” Then we nod our heads off as we listen to each other’s amusing, and sometimes horrible, tales.

In the mid-90s, during one of those evenings of bantering, a friend told me about the impossible mission she was on. Her managers wanted a program that would analyze X-ray scans and identify diseases, such as pneumonia.

My friend had warned management that the task was hopeless, but they refused to believe her. If a radiologist could do it, they reasoned, then why not a Visual Basic program? They even paired my friend with a professional radiologist, so that she could learn the job and turn it into code. That experience only reinforced her opinion that radiology required human judgment and intelligence.

We laughed at the futility of the task. A few months later, the project was canceled.

Fast-forward to more recent times: in late 2017, a research team at Stanford University published an algorithm to diagnose pneumonia from X-ray scans.[6] The algorithm wasn’t just okay—it was more accurate than professional radiologists. That was supposed to be impossible! How the heck could they write that code?

The answer is that they didn’t. Instead of writing code, they cracked the problem with machine learning. Let’s see what that means.