You never wrote out rules for recognizing a cat — you saw many cats and learned. Machine learning works the same way: instead of being programmed with rules, it's shown thousands of examples and figures out the pattern itself.
Rules you write vs. patterns it finds
In ordinary programming, a human writes every rule: if the light is red, stop. Machine learning flips this around. Instead of rules, you give the computer many labeled examples — thousands of photos tagged cat or dog — and it discovers the patterns that tell them apart on its own. The result is a model: a bundle of learned patterns that can label new, unseen examples.
A model only knows what its examples taught it. Show it only photos of black cats and it may decide cats are always black. The data is the lesson — biased data teaches biased lessons.
- On paper, invent a rule to separate spam from real messages using only two clues: number of ALL-CAPS words and number of links.
- Now instead, collect 6 example messages and label each spam or not. Look for a pattern in your two clues.
- Write the boundary you found (for example: 'spam if caps + links is 3 or more').
- Test your boundary on 2 fresh messages. Did learning from examples beat your first hand-written rule?
What you should see: You experienced both approaches and saw how a boundary learned from examples can capture patterns you would not have written by hand.