What is training data in AI?
Training data in AI is the collection of examples a model learns from during training.
A machine learning model does not come with rules written by a programmer. Instead, it looks at thousands or millions of examples and finds patterns on its own. Those examples are the training data. Some everyday cases:
- Spam filter: emails marked "spam" or "not spam".
- Crop disease app: leaf photos tagged with the disease name or "healthy".
- House price model: past sales with area, location, number of rooms and final price.
- Chatbots and LLMs: huge amounts of text, such as web pages, books and code, plus smaller sets of human written example conversations.
If the training data is wrong, incomplete or one-sided, the model will copy those problems, which is how AI bias often starts.
What is training data and testing data?
Training data is the part of your dataset the model learns from, and testing data is a separate part kept hidden until the end to check how well the model works on examples it has never seen.
Most projects also keep a third part, validation data, for tuning while training is still going on.
| Point | Training data | Validation data | Testing data |
|---|---|---|---|
| Purpose | Teach the model | Tune settings and pick the best version | Give a final, honest score |
| Does the model learn from it? | Yes | No, only used to check | No |
| When used | Every epoch | During training, after each epoch | Once, at the very end |
| Exam analogy | Textbook and practice questions | Mock tests | The real board exam |
| Typical share (rule of thumb) | About 70 to 80 percent | About 10 to 15 percent | About 10 to 15 percent |
The golden rule: testing data must stay unseen. If it leaks into training, your test score becomes meaningless, like a student who saw the question paper a day early.
Why do we split data into training and testing sets?
We split data so we can measure how well a model handles new data, not just data it has already memorised.
A model can score nearly 100 percent on its own training data and still fail in the real world. That problem is called overfitting. The only way to catch it is to test on examples the model never trained on.
The split also keeps you honest. If you keep changing your model until the test score looks good, the test set slowly turns into another training set. That is why the validation set exists: you tune on validation data and touch the test set only once.
A few practical rules help:
- Shuffle before splitting, so each part has a fair mix of examples.
- Keep classes balanced across splits (called stratified splitting) when some labels are rare.
- For time based data, like sales or stock prices, train on older data and test on newer data instead of shuffling.
- Remove duplicates that appear in both training and testing data.
What is a good train test split ratio?
A common rule of thumb is 80 percent training and 20 percent testing, or 70 percent training, 15 percent validation and 15 percent testing when you need a validation set.
These numbers are starting points, not laws:
- Very large datasets: even 1 or 2 percent of a million examples is plenty for testing, so splits like 98, 1 and 1 are used.
- Small datasets: a single split can be unlucky. Use k-fold cross-validation, where the data is split into k parts and each part takes a turn as the test set.
- Imbalanced data: make sure rare classes appear in every split.
I suggest you decide the split before you look closely at the results, write it down, and never change the test set to make your model look better. Interviewers for data scientist roles often probe exactly this habit.
What makes good training data?
Good training data is accurate, correctly labelled, large enough and representative of the real situations the model will face.
- Correct labels: in labelled training data, every example carries the right answer, such as "cat" on a cat photo. Wrong labels teach wrong lessons.
- Representative: a face detection model trained mostly on one skin tone, or a speech model trained only on one accent, will work worse for everyone else.
- Enough variety: different lighting, angles, languages, regions and edge cases.
- Clean: duplicates, blank rows and corrupted files removed.
- Legal and ethical: collected with permission, respecting privacy and copyright.
Labelling is often done by people, which is slow and costly, so teams write clear labelling guidelines and check samples for agreement between labellers.
For LLM fine-tuning, training data often looks like simple question and answer pairs, one example per line, in a format called JSONL:
{"prompt": "What is the capital of India?", "completion": "New Delhi"}
{"prompt": "Translate to Hindi: Good morning", "completion": "Suprabhat"}The exact format changes from provider to provider, so always follow the current documentation.
Training data and testing data for Class 10 AI students
For CBSE Class 10 AI, remember this: training data is used to teach the model, and testing data is used to check how well the model learned.
In the AI project cycle you study, collecting data happens in the Data Acquisition stage, and testing data is used in the Evaluation stage. A simple exam friendly example:
- You want an AI that tells apples from oranges.
- You collect 1,000 labelled fruit photos.
- You use 800 photos as training data so the model learns colour, shape and texture.
- You keep 200 photos as testing data and ask the model to identify them.
- If it gets 180 right, its accuracy on testing data is 180 out of 200, which is 90 percent.
The testing photos must be different from the training photos, otherwise the test is not fair.