Lecțiile acestui traseu sunt publicate deocamdată doar în engleză, așa că lecția de mai jos apare în engleză. Restul — module, quiz și materiale — funcționează la fel.
How Models Learn, and What "95% Accurate" Means
Vei putea să:
You can explain training and test sets and overfitting, and work out from a base rate how many of a model's alarms are real.
A clinic buys a screening tool advertised as 95% accurate. A patient is flagged. How likely is it that the patient has the condition? Most people answer "about 95%". If one person in a hundred has the condition, the real answer is about 16%. This lesson explains how a model learns and why its headline number so often misleads.
Learning from examples
A predictive model learns from labelled examples: thousands of emails marked spam or not spam, or thousands of scans marked healthy or not. It starts with random numbers. It makes a guess for one example, the guess is compared with the label, and its numbers are nudged so the guess would have been slightly better. After millions of rounds the numbers capture whatever pattern separates the examples.
"Whatever pattern" is the catch. The model has no idea which differences matter to you. In a well-known 2016 demonstration, researchers trained a classifier to tell wolves from huskies, using photos they had chosen so that every wolf stood in snow. It learned to look for snow and not for the animal, and only an explanation tool made that visible. A model learns the easiest pattern that works on its examples, and that is not always the one you meant.
Training set, test set, overfitting
To find out whether a model learned something general, builders hold back some examples and never show them during training. The held-back group is the test set. A model that does well on its training examples and badly on the test set has memorised the examples. This is called overfitting.
A test score has a limit of its own. It tells you how the model does on cases like the test set. A model trained and tested on scans from one hospital can drop sharply at another hospital with different machines. The test was honest. The world was different.
Worked example: what "95% accurate" means
Take 10,000 people. One in a hundred has the condition.
- 100 people have it. The tool finds 95% of them: 95 correct alarms.
- 9,900 people do not have it. The tool wrongly flags 5% of them: 495 false alarms.
- In all, 95 + 495 = 590 people are flagged, and 95 ÷ 590 = 16% of them have the condition.
The tool is not broken. The condition is rare, so the healthy group is a hundred times larger, and a small error rate on a large group gives more false alarms than there are real cases.
Change the three numbers and watch the share of real alarms move:
Laborator
Câte alarme sunt reale?
| Persoane testate: 10,000 | Semnalați | Nesemnalați |
|---|---|---|
| O au 100 | 95 | 5 |
| Nu o au 9,900 | 495 | 9,405 |
Dintre cei 590 semnalați, 16% au afecțiunea.
Instrumentul are dreptate pentru 95% dintre toți cei testați.
Încearcă o întrebare
Sunt testate 10.000 de persoane. 5% au afecțiunea. Instrumentul găsește 80% dintre cazurile reale și semnalează greșit 5% dintre cei care nu o au. Dintre cei semnalați, ce procent au afecțiunea?
Numerele se schimbă de fiecare dată. Răspunsul este calculat de laborator.
Rulează în browserul tău. Nimic nu este trimis sau salvat.
The same arithmetic produces a second trap. If one transaction in a thousand is fraud, a model that says "not fraud" every time is 99.9% accurate and useless.
So when you see one accuracy figure, ask three things:
- Of the real cases, how many does it find?
- Of the cases it flags, how many are real?
- What data was it tested on, and does that data look like mine?
Try it now (10 minutes)
Open Teachable Machine, a free tool that trains a small image model in your browser. Train it to tell two objects apart, for example a mug and a phone, with about thirty webcam images of each. Test it. Then hold the mug in front of a different background, or in your other hand. Note what breaks it. You have just reproduced the wolf-and-snow problem.
Where people go wrong
- Reading accuracy as "chance that this alarm is right". These are different numbers, and for rare events they are far apart.
- Trusting a test score without asking what the test set was. A score from someone else's data is a claim about someone else's data.
- Assuming the model learned the concept. It learned a pattern that separated the examples. Check what it does when the background changes.
What to remember
- A model learns the easiest pattern that separates its examples, whether or not it is the right one.
- Good on training data and bad on held-back data means it memorised.
- A test score holds only for cases like the test set.
- For rare events, ask how many real cases are found and how many alarms are real. A single accuracy figure hides both.
Materiale selectate
1hMunca de profunzime se întâmplă aici — lecția este briefingul tău.
În direct pe aiqbench
Subiectul acestei lecții în restul site-ului, astăzi.
În știri, ultimele 30 de zile
- Build a PDF Chatbot for Your Website with Gradio and Hugging Face ZeroGPUTowards Data Science ·
- From chatbots to AI agents: Banco Guayaquil’s next chapter in bankingSiliconANGLE ·
- When Does Fine-Tuning Overtake Prompting? An Accuracy and Cost Analysis of Small Language Models on Narrow TasksarXiv ·
Testează-ți cunoștințele
5 întrebări în 100 de secunde, pe o pagină separată. Citește mai întâi tot ce este mai sus.
Testează-ți cunoștințele →Misiunea modulului
25–30 minIn Teachable Machine, train a model to tell two objects apart with about 30 images each. Test it on 10 new images and record the score. Then find three inputs it gets wrong and write what you think it learned.
Cum arată un răspuns bun
- A score out of 10 on new images, none of which were used for training.
- Three inputs the model got wrong, each described so someone else could repeat it.
- For each failure, a one-line guess at the pattern the model used instead of the object.
- One sentence on which extra images would fix it.
Se încarcă lucrarea ta…