The concept
When we say a machine "learns from examples," we mean this:
- It starts with a rough guess at a rule.
- It tests the guess on examples where we already know the right answer.
- It measures how wrong it was (the "error").
- It nudges the rule to be a little less wrong.
- It repeats until the error stops shrinking.
No intuition, just many small corrections. The rule it ends up with is called a "model."
Walkthrough: predicting house prices
You have four houses that recently sold:
- 1,000 sq ft → $200,000
- 1,500 sq ft → $275,000
- 2,000 sq ft → $350,000
- 2,500 sq ft → $425,000
Goal: predict the price of a house that isn't on the list. The machine's rule has two dials: a starting price, plus a price per square foot.
Round 1: it guesses $0 to start, plus $100 per sq ft.
For the 2,000 sq ft house it predicts $200,000. Real price: $350,000. Too low by $150,000. Every house is too low, so it turns both dials up.
Round 2: now $0 plus $200 per sq ft.
The 2,000 sq ft house: $400,000. Too high by $50,000. It turns the per-foot dial back down a bit.
Rounds 3 to 1,000: the same loop, smaller and smaller nudges, checking all four houses each time.
Where it settles: $50,000 plus $150 per sq ft. Check it: 1,000 sq ft → $50k + $150k = $200k. It matches every house.
Now the useful part. A new 1,800 sq ft house comes on the market:
$50,000 + (1,800 × $150) = $320,000.
Nobody typed "$150 per square foot" into the computer. It found that number by being wrong, measuring how wrong, and correcting. That's learning.
Real data is messier (location, age, bedrooms), so real models have many more dials and never fit perfectly. The loop is the same.
Where you see it at work
- Banking: estimating how likely a loan is to be repaid, learned from past loans and their outcomes.
- Insurance: estimating a claim's cost from thousands of settled claims.
- Retail: forecasting next week's sales per store from past weeks.
- Product and business analysis: predicting which customers may cancel, using past customers who did or didn't.
Same idea every time: past examples with known answers in, a rule out.
In one sentence
A machine "learns" by guessing, measuring how wrong it was on examples with known answers, and adjusting, over and over, until its guesses get good.