Skip to main content
Machine Learning & Deep Learning

⏱ About 10 min10 XP

The Sorting Machine

You have collected labeled examples. You have built a dataset. Now comes the exciting part: you hand all of that to a machine, and the machine studies it — and after enough studying, it can sort things it has never seen before! How does that work? Let's find out.

Learning From Examples

Think about how you learned to read. At first, your teacher showed you the letter A over and over — big A, small a, A in different fonts. She told you 'this is A' every time. After many examples, your brain learned the pattern. Now you can recognize A anywhere, even in a handwriting style you have never seen. A sorting machine learns the same way. You show it hundreds of labeled examples. The machine looks for patterns — clues that tell one group apart from another. For apples and oranges, the machine might notice: apples are often red or green, with a smooth skin. Oranges are usually orange-colored and have a bumpy skin. It learns these patterns from the labels.

The Big Idea

A sorting machine studies labeled examples, finds patterns in each group, and then uses those patterns to sort new examples it has never seen before.

Once the machine has learned, you can show it a brand-new photo — one that was NOT in the training dataset. The machine looks at the photo, checks its patterns, and makes a guess: 'apple' or 'orange.' This guess is called a prediction. The machine predicts which group the new thing belongs to. If the machine learned well from good labeled examples, its predictions will usually be right. If the labels were messy or there were not enough examples, the predictions might be wrong.

Fill in the missing word to complete the sentence.

When a machine looks at a new example and decides which group it belongs to, that guess is called a .

Here is an important thing to remember: the machine is not magic. It does not think like a person or feel anything. It is just very good at finding patterns in numbers and using those patterns to make fast guesses. A human teacher first has to label the examples. Without those labels, the machine has nothing to learn from.

More Examples, Better Learning

The more labeled examples you give a machine, the more patterns it can find, and the better its predictions become. This is why datasets for real machines often have thousands or even millions of examples.

What is a prediction in a sorting machine?

Where does the sorting machine get its patterns from?

Be the Sorting Machine

  1. Ask a family member to collect 10 objects and put them in a bag without showing you.
  2. Have them hand you the objects one at a time and tell you the label for the first six: for example, 'heavy' or 'light.'
  3. After seeing six labeled examples, try to predict the label for the next four before they tell you.
  4. How many did you get right?
  5. Talk about which clues — weight, size, texture — helped you make good predictions.