Skip to content

Beginning of the lesson

The Big Idea: Learning from Examples, Not Instructions

In traditional programming, a person writes exact instructions for the computer: "if the fruit is red and round, call it an apple." But for many real problems — recognising faces, understanding speech, spotting spam — nobody can write down all the rules. There are simply too many, and many of them we cannot even describe in words.

Machine learning flips the approach: instead of giving the computer rules, we give it lots of examples and let it discover the rules on its own. The computer studies the examples, finds patterns that repeat, and stores a compressed summary of those patterns. That summary is called a model, and it can then make predictions about things it has never seen before.

By the end of this lesson you will be able to:

  • Explain the difference between programming with rules and learning from examples
  • Define data, features, and labels, and identify them in everyday situations
  • Describe how repeated examples reveal patterns, and what a model really is
  • Tell apart the training phase and the using phase (inference)
  • Explain why more and better data usually means a better model — and what "garbage in, garbage out" means
1. Two Ways to Make a Computer Smart

Imagine you want a computer to sort fruit into apples and oranges. There are two very different strategies:

Classic programming (rules first)

A human writes the rules by hand:

IF color is red AND shape is round
    THEN it is an apple
IF color is orange AND skin is bumpy
    THEN it is an orange

Works for simple problems, but breaks the moment reality gets messy — green apples exist, some oranges are yellowish, lighting changes colors in photos.

Continue this lesson on YourAIZone

The full lesson has the complete explanation, worked examples, common mistakes, tests with instant checking and an AI tutor. Start right away as a guest, or create an account to keep your progress.

In the full lesson

  • The complete explanation
  • Worked examples
  • Common mistakes and how to avoid them
  • Test questions: 15
  • AI tutor that answers questions about the topic
  • Progress tracking for students, parents and teachers