FoundationsCore· 25 min read

Types of Machine Learning

There are three families: supervised, unsupervised and reinforcement learning.

What you will learn

  • Name the three types of ML
  • Match a real task to the right type
  • Know which type this course focuses on

Three families of learning

Almost every ML task fits into one of three families. They differ by what you give the computer to learn from.

TypeYou give itIt learns toExample
SupervisedExamples with answers (labels)Predict the answer for new dataSpam / not-spam, house prices
UnsupervisedData with no answersFind natural groups or structureGroup customers by behaviour
ReinforcementA goal plus rewards/penaltiesAct to earn the most rewardGame-playing AI, a robot walking

An analogy that sticks

  • Supervised = studying with an answer key. Each example comes with the correct answer, so you learn by checking your guesses.
  • Unsupervised = sorting a messy drawer with no instructions. You just group similar things together.
  • Reinforcement = learning a video game. Nobody tells you the moves; you try things and learn from the score.

Tagging tasks in code

Matching three everyday tasks to the three ML families
# Which type fits each task?
tasks = {
    'predict house price from size':     'supervised',    # has answers (prices)
    'group shoppers by what they buy':   'unsupervised',  # no answers, find groups
    'teach a robot to walk':             'reinforcement', # learns from reward
}
for task, kind in tasks.items():
    print(task, '->', kind)

Note: Output: predict house price from size -> supervised group shoppers by what they buy -> unsupervised teach a robot to walk -> reinforcement The quick test: do your examples come with the right answers? If yes, it is supervised.

Supervised learning is the most common and the best place to start, so most of this course focuses on it. We will also try unsupervised learning later (clustering). Reinforcement learning is powerful but advanced, so we only describe it here.

Tip: How to choose fast: predicting a known answer? Supervised. Exploring data to find groups? Unsupervised. Learning by trial and error toward a goal? Reinforcement.

Q. You have 10,000 photos each labelled “cat” or “dog” and want to label new photos. Which type is this?

Answer: You have labelled examples and want to predict the label for new photos — that is classic supervised learning.

✍️ Practice

  1. Label each as supervised / unsupervised / reinforcement: predicting tomorrow’s temperature; grouping songs by sound; an AI learning chess.
  2. Write down one real task from your own life for each of the three types.

🏠 Homework

  1. Pick one ML type and find two real products that use it. Note what each product does.
Want to learn this with a mentor?

CodingClave runs guided, project-based training (28-day, 45-day & 6-month batches).

Explore Training →