Lesson 1.1 · 6 min read · about 45 min to master at a very slow pace

What is Machine Learning?

Machine learning is learning a prediction rule from data instead of writing it by hand. What that means, how it differs from traditional programming, and why the decision matters more than the prediction.

Not startedJump to quiz

The one-sentence version

Machine learning (ML) is about making predictions and decisions from data. Instead of a programmer writing the rule, an algorithm learns the rule from examples. The term was coined by Arthur Samuel in 1959, whose checkers program learned to play better than he did by adjusting its own scoring rule from experience.

Traditional programming vs machine learning

In traditional programming you write the rules and the computer applies them. In machine learning you supply examples of inputs and the right outputs, and the algorithm finds a rule that maps one to the other.

Traditional programmingMachine learning
You provideRules + dataData + answers (examples)
Computer producesAnswersRules (a fitted model)
Spam filter example"If the subject contains FREE!!! then spam"Learn which word patterns separate 100,000 labelled spam and non-spam emails
Breaks whenThe world changes faster than you can update the rulesNew data stops looking like the training data

ML shines when the rule is too complicated to write down (recognising a face), changes over time (fraud patterns), or must be personalised (recommendations).

A model is a function

Whatever the method, the output of learning is a function that takes inputs (also called features or predictors) and returns a prediction of the target (also called the response, outcome or label). The hat on always means "estimated" or "predicted".

ML is not one technique. It is a toolbox of models (linear regression, logistic regression, SVMs, K-means, trees, neural networks...) and of methods for fitting and checking them.

Predictions exist to support decisions

A prediction is rarely the end goal. A hospital predicts readmission risk so it can decide who gets a follow-up call; a bank predicts default so it can decide whether to lend. That has a big consequence that runs through this whole course: the costs of different mistakes matter. Missing a sick patient is not the same as calling a healthy one, so "most accurate" and "most useful" are not always the same model.

Big idea

Machine learning is not about fitting the data you have. It is about predicting data you haven't seen yet, well enough to make good decisions.

Where ML sits

ML is part of the broader field of artificial intelligence, and it grew out of statistics and pattern recognition. Statistics and ML share most of their goals but historically differ in emphasis: statistics focuses more on inference (is this effect real?) and ML more on prediction at scale. The two are converging, and this course uses both perspectives: you will compute p-values and worry about test-set performance.

How it's asked

"Define machine learning and explain how it differs from traditional programming." A full answer mentions: learning a rule from data rather than coding it, the model as a function from inputs to outputs, and generalisation to new data as the goal.

Cheatsheet

Machine learning

Learning a prediction rule from data so that predicts well on new data.

Features vs target

Features / predictors : the inputs. Target / response / label : what we predict.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1applyAn online shop wants to flag fraudulent orders. Fraud patterns change every few weeks and show up as combinations of hundreds of weak signals. It has two years of orders labelled fraud / not fraud. Why is machine learning a better fit than hand-written rules?
Q2conceptA system stores every training example and, for a new input, returns the answer of the identical stored input. Why is this not useful machine learning?
Q3conceptIn , which description is correct?
Q4applyTwo models predict which patients will be readmitted. Model A has higher overall accuracy. Model B catches more of the patients who are readmitted but raises more false alarms. A missed readmission costs far more than an unnecessary follow-up call. Which model is more useful?
Q5conceptHow do statistics and machine learning relate?