Consider the problem of finding the K nearest neighbors of a data object. A programmer designs Algorithm

Question:

Consider the problem of finding the K nearest neighbors of a data object. A programmer designs Algorithm 2.1 for this task.
Algorithm 2.1
Algorithm for finding K nearest neighbors.
1: for i = 1 to number of data objects do
2: Find the distances of the ith object to all other objects.
3: Sort these distances in decreasing order.
(Keep track of which object is associated with each distance.)
4: Return the objects associated with the first K distances of the sorted list
5: End for
(a) Describe the potential problems with this algorithm if there are duplicate objects in the data set. Assume the distance function will only return a distance of 0 for objects that are the same.
(b) How would you fix this problem?
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Introduction to Data Mining

ISBN: 978-0321321367

1st edition

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

Question Posted: