Skip to content
GATEiit

GATE DA 2024 Q63: Smallest odd k for which k-NN labels the point square

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 kk in kk-nearest neighbor algorithm for which the diamond (⋄) shaped data point is assigned the label square is ______.

Grid plot: circles at (1,1) and (1,2), squares at (2,3), (3,3) and (3,2), and a diamond query point at (2,1)
Tap the figure to enlarge

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 5 (official GATE 2024 final answer key)

Concept used: kk-NN classifies by majority vote among the kk nearest training points.

First step: From the diamond at (2,1): circle (1,1) at 1, circle (1,2) and square (3,2) at 2\sqrt{2}, square (2,3) at 2, square (3,3) at 5\sqrt{5}.

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

WhatsAppDownload image

Source: official GATE 2024 DA question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key