Test, reflect, improve
Find the mistakes, then fix the examples.
Who gets left out?
A simple machine learns to guess rain, but only from monsoon days. Then it is tested on monsoon, winter and summer days. Where will it do worst?
What this lesson covers
The idea
To improve an AI tool, test it on new cases, reflect on the mistakes it makes, then improve the examples and test again.
Who gets left out?
A simple machine learns to guess rain, but only from monsoon days. Then it is tested on monsoon, winter and summer days. Where will it do worst?
- On monsoon days
- On winter and summer days
- About the same on all days
Teach, test, improve
You choose the examples for a very simple weather machine. Pick 6 days from the diary, then see how it does on new days from each season.
If a season does badly, look at which days it got wrong. Then try again with better examples.
The loop at work
The machine did best on days like the ones it was taught from. If a season scored badly, its wrong guesses pointed to days the machine had no example of. A misty grey day and a dust storm were two.
Adding those days and testing again is the loop: test, reflect, improve. A score for each group shows who is being missed, even when the total looks fine.
To improve an AI tool, test it on new cases, reflect on mistakes, then improve the examples and test again.
Cases kept back for the exam are called a test set. A tool should never be tested only on what it has already learned from.
Notes
To improve an AI tool, test it on new cases, reflect on mistakes, then improve the examples and test again.
Check the score for each group, not only the total. And never test only on what the tool has already learned from.
Check yourself
Lakshmi's photo tool scores 100% on the photos it learned from. What does that show?
A leaf-photo tool is tested on 20 rice leaves and 20 wheat leaves. It gets 18 rice photos right and 12 wheat photos right. What is its overall accuracy?
Answer: 75 %
18 + 12 = 30 right out of 40 photos. 30 ÷ 40 = 0.75, which is 75%.
Rice scores 90% and wheat scores 60%. What should the team do before giving the tool to farmers?
- That it will also be right on new photos. Not so. It has only shown that it can repeat what it already saw. New photos are the real test.
- Very little, so test it on new photos — correct. A student who memorises the answer sheet looks perfect on that sheet. Only new questions show real learning.
- That she does not need to test it. Testing protects people from a tool that only looks good. Skipping it is risky.
- Add more wheat photos to the examples and test again — correct. The weak crop points to missing examples. Fixing that and testing again is the loop. Wheat farmers deserve advice as good as rice farmers get.
- Use it now, since the overall score of 75% is fine. An average can hide a group that is served badly. Wheat farmers would get far more wrong advice than rice farmers.
- Leave wheat out of the test so the score looks better. That hides the problem instead of fixing it. A fair test includes everyone the tool will serve.