TK Study

Software Engineering › Learn step by step › Y12 Software Automation

Item 313 of 426 · Year 12: Software Automation, 20 of 35

K-nearest neighbour (KNN)

Term Key terms bank

Jump to a topic
  1. Exam format, question types and command words (46)
  2. Year 11: Programming Fundamentals (69)
  3. Year 11: The Object-Oriented Paradigm (33)
  4. Year 11: Programming Mechatronics (29)
  5. Year 12: Secure Software Architecture (57)
  6. Year 12: Programming for the Web (59)
  7. Year 12: Software Automation (35)
  8. Year 12: The Software Engineering Project (47)
  9. Diagrams and modelling tools (18)
  10. Python, SQL, pseudocode and CSS patterns (33)

See every item in the sequence

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 you'll use it 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

How to use it

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)

Official worked answer

Sample exam Q23b (3 marks): Linear regression v K-nearest neighbour (3 marks): official 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

Go deeper

Check yourself

Explain “K-nearest neighbour (KNN)” in one sentence, give an example, and name a question type that could test it.

Reveal the answer

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.

Could be tested as: Short answer, Multiple choice.

Quick multiple choice

K-nearest neighbour (KNN) classifies a new item by:

  1. Looking at the labels of the K closest examples in the training data
  2. Randomly choosing a label
  3. Drawing a straight line through all the data
  4. Removing all labelled data
Show the answer

A

KNN is a supervised algorithm: the majority label of the K nearest neighbours is used. It is not a clustering algorithm (school notes say 'clustering such as KNN' which is incorrect).

Source: original (written for this study pack; not a NESA question). Open it in the multiple-choice bank.