How data is used to train AI
To train a model, a dataset is split into three parts: a training set to learn from, a validation set to tune and compare models, and a test set kept aside for a final, honest check. Each row has features (the inputs) and, for supervised learning, a label (the answer).
Everyday analogy
Preparing for board exams: practice papers to learn (training), mock tests to see what to improve (validation), and the real exam you've never seen (test).
Example
Predicting delivery time. Features: distance, time of day, rain or not, restaurant preparation time. Label: the actual delivery time in minutes. The model learns from thousands of past orders, then predicts for new ones.
A typical split of 10,000 past orders
Feature engineering
Turning raw data into more useful features. For example, from an order date you can create "day of the week", "is it a festival?" and "is it month-end?", which often predict demand far better than the raw date.
Watch out: data leakage
If information from the test set, or from the future, sneaks into training, the model looks brilliant in testing and then fails in real life. Like seeing the exam paper the night before.
Try it yourself
About 10 minSplit the data
- Make a list of 20 numbered rows in a spreadsheet.
- Assign about 14 to training, 3 to validation and 3 to testing (shuffle first).
- Write why the test rows must stay hidden until the end.
What you should see: Keeping test data separate is how you honestly measure a model.
Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.