What is machine learning?
In one line
Ages 8 to 10: Machine learning is when a computer works out its own rule by looking at lots of examples.
Ages 11 to 13: A machine learning system trains a model on labeled examples, then checks it on test examples it never saw while learning.
Ages 14 to 18: Machine learning fits a model's parameters to data by reducing a loss, aiming to make accurate predictions on new data from the same distribution.
Machine learning is a way of making a computer find its own rule from examples, instead of a person writing the rule. The computer studies many examples, finds a pattern, and uses that pattern to make predictions about new cases. Because predictions can be wrong, it is tested on fresh examples.
Last reviewed: 20 October 2026 7 min read
The idea in one picture
Think of a new goalkeeper. Nobody hands them a rulebook for every shot. They face hundreds of shots, notice patterns (where the kicker looks, how they run up) and get better at guessing. Machine learning works the same way: examples first, a rule second.
Worked example: a message filter. A person labels eight messages as "spam" or "not spam". The machine measures one thing: how many exclamation marks each has.
| Label | Exclamation marks in each message |
|---|---|
| Not spam | 0, 0, 1, 2 |
| Spam | 3, 4, 5, 6 |
Every "not spam" message has 2 or fewer. Every "spam" message has 3 or more. So the machine learns the rule: 3 or more means spam. That rule is the model.
A new message with 5 exclamation marks arrives: the model says spam, and it is. Then a friend writes "Happy birthday!!!!". Four marks. The model says spam. It is wrong, because no example taught it that friendly messages can be excited too. The fix is more varied examples, or more clues, such as whether the sender is in your contacts.
How it works, step by step
- Collect examples. Each example has features (the clues, such as exclamation marks) and, for most tasks, a label (the right answer).
- Train. The computer adjusts the model's numbers so its answers on the examples get closer to the labels.
- Keep some examples back. A separate test set, never used in training, is saved for checking.
- Test. The model predicts on the test set, and every right and wrong answer is counted.
- Use and keep checking. The model makes predictions on new cases. When those cases change, it may need new examples and new training.
A little deeper (ages 11 to 13)
There are three main types of machine learning:
- Supervised learning uses examples with labels, like the message filter. It is like studying with questions and their answers.
- Unsupervised learning uses examples without labels and looks for groups or patterns, such as sorting songs into clusters that sound alike.
- Reinforcement learning learns by trying actions and getting rewards, such as a program learning to play by winning and losing.
Testing needs numbers. Say the filter sees 20 test messages and gets 17 right. That is 17 ÷ 20 = 85%. But if 15 of the 20 are "not spam", a lazy rule that always says "not spam" already scores 15 ÷ 20 = 75%. A model is only useful if it beats a simple baseline like that.
Going further (ages 14 to 18)
A model is a mathematical relationship with adjustable numbers, called parameters. Training fits those parameters to the data: a loss function measures how far predictions are from the labels, and an algorithm such as gradient descent changes the parameters step by step to make the loss smaller.
The goal is not a low loss on the training data. It is good predictions on new data drawn from the same distribution as the training data. A model that matches its training examples too closely and fails on new ones is overfitting. Holding out a test set is how you find out.
That phrase, "the same distribution", is where many real failures start. If new cases differ from the training examples, such as people, accents or lighting that were rare in the data, accuracy can drop for those groups while the overall number still looks fine. Checking results group by group is part of testing.
Machine learning that predicts a label or a number is sometimes called predictive ML. Generative AI uses models that learn from examples and then produce new content.
Common mix-ups
- Mix-up: "Machine learning and AI are the same thing."Fact: Machine learning is one approach inside AI. Some AI systems follow rules that people wrote, with no learning at all.
- Mix-up: "The computer understands the examples."Fact: It finds statistical patterns in the features it is given. The filter never knew what a birthday was; it only counted marks.
- Mix-up: "More data always fixes it."Fact: More of the same kind of examples does not help with a case the data never covered. Varied, well-labeled examples matter.
- Mix-up: "Once trained, it's finished."Fact: A model can drift out of date when the world changes, so it needs fresh tests.
Try it (no device, 5 minutes)
Write 8 short made-up messages on scraps of paper and label each "spam" or "not spam". Pick one clue you can count (exclamation marks, capital letters, the word "free"). Sort the scraps by that count and draw a line where the labels change. Then someone writes 3 new messages without showing the labels, and you predict each one with your line. How many did your rule get right? Which clue would fix the mistakes?
Quick check
The filter's rule is "3 or more exclamation marks means spam". What does it say about "See you at 4!"?
Answer: Not spam. It has one exclamation mark, which is fewer than 3.
Not spam. It has one exclamation mark, which is fewer than 3.Why are some examples kept back and never used in training?
Answer: So the model can be tested on cases it has never seen. Testing on the training examples would only show that it remembers them.
So the model can be tested on cases it has never seen. Testing on the training examples would only show that it remembers them.Sorting photos into groups that look alike, with no labels given. Which type of machine learning is that?
Answer: Unsupervised learning, because the examples have no labels and the system looks for groups on its own.
Unsupervised learning, because the examples have no labels and the system looks for groups on its own.Questions
Machine learning is a way for a computer to learn a rule from examples instead of being given the rule. It looks for a pattern in examples with known answers, then uses the pattern to make guesses about new cases.
Supervised learning learns from labeled examples, unsupervised learning finds groups or patterns in unlabeled examples, and reinforcement learning learns from rewards for its actions. Generative AI, which makes new content, also learns from examples.
AI is the broad field of making computers do tasks that seem to need intelligence. Machine learning is one way to build AI, where the system learns its behavior from examples rather than following only rules that people wrote.
A model only knows the patterns in the examples it learned from. When a new case is unlike those examples, it can give a confident wrong answer, which is why models are tested on fresh examples.
A message filter that learns to spot spam from examples labeled "spam" and "not spam" is machine learning. So is a system that learns to recognize objects in photos from many labeled pictures.
Mechna Academy is a city of machines for curious children aged 8 to 18, opening first to ages 8 to 10. In each mission, a child guesses how a machine decides, then opens its Peek Hatch to check, changes one thing and tests it on a case it has never seen. Children learn how AI works this way, and they never chat with an AI.
For grown-ups: join the waitlistPlaces are limited. The waitlist is for parents and guardians 18 and older.