Why machine learning?01 / 25

Some rules
we write.
Others we learn.

From sorting numbers to seeing the world.
Four problems. Two ways to solve them.

Rules: sort 7, 3, 5 into 3, 5, 7. Learning: varied boot images feed a network that recognizes a boot.
YOUR LEARNING NOTEBOOK · OPTIONALPredict. Investigate. Explain.Open before the lab. Return with evidence.

Make a prediction before you experiment. Afterward, compare it with what happened and apply the idea to a different situation.

01

Before the experiment

Which task needs examples: sorting numbers, recognizing footwear, or describing an unfamiliar scene? Explain what a written rule would need to know.

02

Try it in the lab below

Run the sorting algorithm, inspect the classifier, and compare an image description with the actual image. Identify the input, output, and source of correctness in each task.

Name one result you can check exactly and one result that needs evidence beyond a plausible answer.

03

A different situation

A shop needs invoice totals and a way to recognize damaged boxes. Which parts would you implement with rules, which with learned models, and how would you check each?

Compare your reasoning with an explanation

Sorting and invoice arithmetic have precise rules and exact checks. Visual recognition usually benefits from examples because a usable boundary is difficult to specify for every image. A generated description still needs comparison with the image. Learning is appropriate when its evidence and error costs justify it; it is not a requirement for every automated task.

Use this to check your reasoning against the experiment. Your written notes are not automatically graded.

SMALLEST LARGEST0 comparisons · 0 swaps
4
01
1
02
6
03
2
04
5
05
3
06

Put the numbers in order, from smallest to largest.

01 / FOLLOW A RULE

A recipe for
the right answer.

  1. 1Compare two neighbors.
  2. 2If the left is bigger, swap them.
  3. 3Repeat until a full pass makes no swaps.

We wrote the rule. It works on new numbers without learning from examples.

This algorithm is called bubble sort.

But what if the rule is hard to describe?

Reflection & vocabulary
CHECK YOUR INTUITION

Why learn an image classifier when we can write an algorithm for sorting?

Algorithm
A sequence of explicit steps, such as comparing and swapping neighboring numbers.
Features
The numbers a model receives as inputs, such as the brightness of image pixels.
Labels
The desired answers in supervised learning, such as “sneaker” or “ankle boot.”
Prediction
A model’s output for an input. It is an estimate, not a fact.
Further reading
←→