GATE DA 2024 Q63: Smallest odd k for which k-NN labels the point square
- Machine Learning
- 2 marks
- NAT
- No negative marking
Question
Given the two-dimensional dataset consisting of 5 data points from two classes (circles and squares) and assume that the Euclidean distance is used to measure the distance between two points. The minimum odd value of in -nearest neighbor algorithm for which the diamond (⋄) shaped data point is assigned the label square is ______.

Try it: numerical answer: type the value
Show answer and explanation
Answer: 5 (official GATE 2024 final answer key)
Concept used: -NN classifies by majority vote among the nearest training points.
First step: From the diamond at (2,1): circle (1,1) at 1, circle (1,2) and square (3,2) at , square (2,3) at 2, square (3,3) at .
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2024 DA question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key