TK Study

Software Engineering › Key terms › Y12 Software Automation › K-nearest neighbour (KNN)

K-nearest neighbour (KNN)

Term Key terms bank Y12 Software Automation

Also listed as: K-nearest neighbour

Definition

Classifies a new item by looking at the K closest items in the training data and choosing the most common class among them.

Example: With K = 3, the three nearest points vote.

Found in: syllabus, sample exam and familiarisation guidelines, school notes.

Short version to memorise (key terms bank)

Classify by the majority of the K closest points.

Where it is used in the test

Syllabus area: Y12 Software Automation.

Question types it can appear in

Where it has appeared in the paper

Software Automation (Part B). Part letters follow each paper’s own layout.

Related past questions

These are the questions the flashcard set links to this term. Open each one and compare your answer with its marking criteria.

Study links

How to use it in an answer

A model sentence

General advice, built from the definition and example above

“Classifies a new item by looking at the K closest items in the training data and choosing the most common class among them.” Then apply it: With K = 3, the three nearest points vote.

In a short answer, give the definition in your own words first, then tie it to the situation in the question. Do not copy the example above unless it fits the scenario.

Command words used with it

From the linked past questions
  • Compare: Show how things are similar or different. (Sample exam Q23b (3 marks): Linear regression v K-nearest neighbour)

Technique for the question types

What the marking guidelines and feedback say

Sample exam Q23b (3 marks): Linear regression v K-nearest neighbour

Some school notes list KNN as unsupervised: that is wrong. NESA's sample answer treats KNN as supervised.

Worked answers from the marking guidelines

Sample exam Q23b (3 marks): Linear regression v K-nearest neighbour (3 marks): criteria and sample answer

Criteria

3: Compares linear regression and KNN. 2: Outlines features of one or both. 1: Some relevant information.

Sample answer

Linear regression and K-nearest neighbours (KNN) are both supervised learning algorithms that make predictions from labelled data. The key difference is how they handle data: linear regression assumes a linear relationship between input features and the target variable, while KNN makes predictions based on the closest 'K' training examples, allowing it to handle more complex, non-linear patterns. However, KNN can be more computationally expensive than linear regression and is usually slower.

Open the question page

Common mistakes

General advice
  • Use the term exactly as the syllabus words it, then link it to the scenario in the question; the 2025 feedback repeatedly rewards using the stimulus.
  • Answer the command word: outline gives main points only, explain gives a reason or cause, discuss gives both sides.

Same group in the syllabus: Decision tree · Neural network · Linear regression · Polynomial regression · Logistic regression · OOP for ML programming · Neural network code (predict)