Skip to content

Labs · 9618 18.1 · machine learning

Nearest Neighbours

Sort songs into dance and calm by asking their nearest neighbours. Choose k, scale the axes and find out what happens when the data is one-sided.

4 levelsFree bench

In the exam

9618/32 October/November 2022 · Question 7 · 4 marks

Supervised and unsupervised learning are two categories of machine learning. Describe supervised learning and unsupervised learning.

Points that gain marks

  • Supervised: it is trained on labelled data: example inputs given with their correct outputs.
  • Supervised: it learns from past examples and predicts outputs for new data.
  • Unsupervised: it is given only input data, with no labels and no correct outputs.
  • Unsupervised: it finds unknown patterns or groups in the data by itself.

In this lab: k nearest neighbours is supervised: every song it learns from already has its label (dance or calm), and it predicts the label of a new song. Level 4 shows why the labelled examples must cover every kind of song.

9618/31 May/June 2026 · Question 9(a) · 4 marks

Explain how supervised learning and unsupervised learning are trained.

Points that gain marks

  • Supervised learning uses labelled training data …
  • … to predict future events from past outcomes.
  • Unsupervised learning uses unlabelled training data, without the correct outcomes …
  • … and searches for hidden patterns, relationships or groups in the data.

In this lab: Here the training data is labelled (every song is dance or calm), so k nearest neighbours is supervised. The k-means lab is unsupervised: the houses have no labels, and it finds the groups by itself.

More real experiments

All labs →

Log in or create account

IGCSE, A-Level & AP