How did you learn to tell a cat from a dog? Nobody gave you a rulebook about ear shapes and whisker lengths. You saw lots of cats and lots of dogs, someone told you which was which, and after a while you just knew.
Most modern AI learns the same way: from lots of examples. The collection of examples it learns from is called a dataset. This guide explains what a dataset is, what “labelled” means, why datasets are split into parts, and why the people who build AI often say the data matters more than anything else.
What is a dataset?
A dataset is an organised collection of data, usually many examples of the same kind, that is used to train or test an AI model.
An example (also called a record, sample or row) is one item in the dataset. Depending on the task, an example could be:
- a photo, for an image recognition model
- an email, for a spam filter
- a row in a spreadsheet, such as a house’s size, location and price
- a sentence or a whole web page, for a language model
- a few seconds of audio, for a speech recogniser
You will also hear the term training data. That simply means the dataset (or the part of it) the model learns from.
Labelled and unlabelled data
Many datasets come with a label for each example: the right answer you want the AI to learn.
| Example | Label |
|---|---|
| Photo of a cat | cat |
| An email | spam |
| A product review | positive |
| Details of a house | price: ₹85,00,000 |
Data with answers attached is called labelled data. It is used for supervised learning, where the model learns to map each example to its label. (That gets its own letter, S, later in the series.)
Data without answers is unlabelled data: millions of photos with no captions, or plain text from books and websites. It is used when the AI should find patterns by itself (unsupervised learning), or when the data contains its own answers, which is called self-supervised learning. Large language models are a good example of the second case. They train on huge amounts of plain text by predicting the next piece of text, so every sentence is its own answer key. See what a large language model is for how that works.
Labels usually come from people, and labelling is slow and costly. That’s one reason large labelled datasets are so valuable.
Two famous datasets
MNIST is a classic beginner dataset of handwritten digits, 0 to 9. It has 70,000 small greyscale images: 60,000 for training and 10,000 for testing. For years it was the “hello world” of machine learning.
ImageNet was a much bigger step. The project, started by Fei-Fei Li, was first presented in 2009. With the help of crowd workers who labelled the images, it grew to more than 14 million images sorted into more than 20,000 categories. A yearly competition built on a smaller part of it, with 1,000 categories, helped spark the deep learning boom of the 2010s. It’s a good reminder that progress in AI often came from better data, not only from cleverer algorithms.
Training, validation and test sets
Here is one of the most important ideas in machine learning. You never test a model on the same examples it learned from.
Why? Think of a student who is given the exact exam questions to practise. They could memorise the answers, score 100%, and still not understand the subject. A model can do the same thing, which is called overfitting (letter O in this series). So a dataset is usually split into three parts:
- Training set. The biggest part. The model learns from these examples. Like studying the textbook.
- Validation set. Used while building the model to compare versions and tune settings. Like practice tests.
- Test set. Kept aside until the very end and used to measure how well the final model works on examples it has never seen. Like the final exam.
A split of roughly 80% / 10% / 10% is common, but there is no fixed rule. Very large datasets might keep only 1% for testing, because 1% of millions is still plenty.
What makes a good dataset?
People in AI like to say “garbage in, garbage out”. A model learns whatever patterns are in its data, good or bad. A good dataset is:
- Relevant. It matches the job. A model trained only on daytime photos may struggle at night.
- Accurate. The labels are correct. Wrong labels teach wrong lessons.
- Representative. It covers the full range of people and situations the model will meet. When groups are missing, the model is worse for them, a big cause of AI bias.
- Big enough. More examples usually help, especially for complex tasks, although quality beats quantity.
- Fresh enough. If the world changes (new slang, new products, new scams), old data becomes less useful.
- Collected properly. It respects privacy, consent and copyright, and personal details are protected.
Where does AI data come from?
- Public datasets made for research, such as MNIST and ImageNet
- Company records, such as past transactions or support tickets
- The web: large language models are trained largely on text gathered from public web pages, plus books, code and other sources
- People labelling data, often through paid annotation work
- Sensors and devices: cameras, microphones, phones, cars
- Synthetic data: realistic examples created by computers, used when real data is rare or private
Common misconceptions
“More data always means a better model.” Only if it’s good data. A huge pile of wrong or one-sided examples can make a model worse.
“A dataset is the same as a database.” A database is software for storing and looking up data. A dataset is a collection of examples prepared for a task. A dataset can be stored in a database, or in plain files.
“Once trained, the model keeps the dataset inside it.” A trained model stores learned patterns as numbers, not a copy of every example. That said, models can sometimes memorise and repeat bits of their training data, which is one reason data privacy matters.
“If the test score is high, the model is ready.” Only if the test set looks like the real world. Check it on the situations and people that will actually use it.
Key takeaways
- A dataset is an organised collection of examples used to train or test an AI.
- Labelled data comes with right answers; unlabelled data doesn’t.
- Data is split into training, validation and test sets so the model is judged on examples it hasn’t seen.
- Garbage in, garbage out: a model is only as good as its data.
- Good data is relevant, accurate, representative, big enough, current and collected responsibly.
Frequently asked questions
What is a dataset in simple words?
A dataset is a collection of examples, like photos, emails or rows in a spreadsheet, that an AI learns from or is tested on.
What is the difference between training data and test data?
Training data is what the model learns from. Test data is kept separate and used afterwards to check how well the model handles examples it has never seen.
How much data does an AI need?
It depends on the task. A simple model might do well with a few thousand examples. Large language models are trained on trillions of tokens of text. Starting from an already trained model (see fine-tuning) can reduce the amount you need a lot.
What is a labelled dataset?
A dataset where each example comes with the correct answer, such as a photo tagged “cat” or an email marked “spam”.
Where can I find free datasets?
Public sources include Kaggle, the Hugging Face Hub, the UCI Machine Learning Repository and government open-data portals. Always check each dataset’s licence before using it.
Comments