Training and testing
An AI model is trained on one set of examples and then tested on new examples it has never seen. Testing shows whether it really learned the pattern or just remembered the answers.
📌 Key points
- Training is when the AI learns from a set of examples called the training data.
- During training, the AI makes guesses, checks them against the labels and adjusts itself to make fewer mistakes.
- Testing is when we check the AI on new examples it did not see during training: the test data.
- We test on new examples because an AI could just remember the training examples, like a student who memorises answers without understanding.
- Accuracy tells us how often the AI is right. If it gets 90 out of 100 test examples right, its accuracy is 90%.
- More data and better data usually make an AI more accurate, especially if the data includes lots of different cases.
- If the AI does badly in testing, people improve the data or the training and try again.
📖 Key words
- Training
- When an AI learns from examples.
- Training data
- The examples the AI learns from.
- Testing
- Checking how well the AI works.
- Test data
- New examples, kept separate from the training data, used to check the AI.
- Accuracy
- How often the AI gives the right answer, often written as a percentage.
✏️ Worked example
A team trains an AI to recognise birds using 1,000 photos. It gets every training photo right. Is it ready to use?
- Getting the training photos right is not enough. It might simply have remembered those 1,000 photos.
- The team tests it on 200 new bird photos it has never seen.
- It gets 150 of the 200 right. Accuracy = 150 ÷ 200 = 75%.
- It makes many mistakes on birds in snow, because the training photos had no snow. The team adds more varied photos and trains it again.
- Answer: not yet. It must be tested on new examples, and the results show what data to add.
Think of training as practising homework questions and testing as a test with new questions. You only know someone has really learned when they can answer questions they have not seen before.
Test yourself8 questions from a bank of 20. A new mix every time.
Start the quiz →