GATE DA 2024 Set 1 — Question 63
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.NAT+2 / -0Mediumk-Nearest Neighbors (k-NN)ClassificationMachine Learning
Machine Learning → Classification → k-Nearest Neighbors (k-NN)
Last updated
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 ______.

Correct answer
5 to 5
Solution
The diamond test point is located at coordinates .
We calculate the Euclidean distance from the diamond to all other labeled points:
We calculate the Euclidean distance from the diamond to all other labeled points:
1.Circle at (1, 1):
2.Circle at (1, 2):
3.Square at (3, 2):
4.Square at (2, 3):
5.Square at (3, 3):
Sorting the neighbors by distance:1.Circle ()
2.Circle ()
3.Square ()
4.Square ()
5.Square ()
Now we check the classification for odd values of :- : Nearest neighbor is Circle. Label Circle.
- : Nearest 3 are {Circle, Circle, Square}. Majority is Circle (2 vs 1). Label Circle.
- : Nearest 5 are {Circle, Circle, Square, Square, Square}. Majority is Square (3 vs 2). Label Square.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE DA question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Classification
2026 Set 1 Q11For a classification problem, Principal Component Analysis (PCA) has been used to reduce the…2026 Set 1 Q12Consider that you are training a classifier for a 10-class classification problem. Each input is…2026 Set 1 Q23In the following table, the
Task column lists a few tasks related to machine learning. The…2026 Set 1 Q29Consider that for a supervised learning task, the objective function being minimized is…2026 Set 1 Q36Let four points in three-dimensional space be: P1: , P2: , P3: …