Machine learning & training data

Machine learning is how AI learns: you show it thousands of examples (the training data) and it finds the patterns by itself. There are three main ways a machine can learn.

Everyday analogy

Learning to make rotis. The first ones are uneven; after a hundred, you just know how much water the dough needs. Practice taught you, not a rulebook.

Example

Every time you press "Report spam", your email app gets one more example. After millions of examples, it spots spam on its own.

📊Training dataexamples with answers⚙️Algorithmfinds the pattern🧩Modelthe learned pattern🔮Predictionanswers new questions
Machine learning: show many examples, let the algorithm find the pattern, then use the model to predict.

The three types of machine learning

Supervised learning

Learns from examples that come with the right answers (labels).

Like: a student practising with an answer key.

e.g. emails marked spam / not spam; house size → price

Unsupervised learning

Gets data without answers and finds groups or patterns on its own.

Like: sorting a mixed jar of buttons by colour and size without being told how.

e.g. grouping customers by shopping habits

Reinforcement learning

Learns by trial and error, getting rewards for good actions and penalties for bad ones.

Like: training a puppy with treats.

e.g. game-playing AI, robots, and fine-tuning chatbots with human feedback

Good to know: LLMs mainly learn by self-supervised learning: they hide the next word in a sentence and practise guessing it, billions of times. The text itself is the answer key.

Try it yourself

About 15 min

Be the training data

  1. Ask an AI chatbot: Act as a model that has never seen fruit. I'll give you labelled examples, then test you.
  2. Give it 5 made-up examples like red, round, sweet = apple.
  3. Test it with a new description and see if it guesses right.

What you should see: Better and more varied examples give better guesses, which is exactly how machine learning works.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectYour first machine learning model: predict house pricesAbout 75 min · Copy-paste code · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.