Solutions1 - Assignment #1 Solutions 13. Consider the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment #1 Solutions 13. 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. for i = 1 to number of data objects do Find the distances of the i th object to all other objects. Sort these distances in decreasing order. (Keep track of which object is associated with each distance.) return the objects associated with the first K distances of the sorted list end for 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. Answer: The main problem is that the nearest neighbor list of an object O may primarily consist of duplicate objects that are different than O, or may primarily consist of duplicates of O. How would you fix this problem? Answer: There are various approaches depending on the situation. One approach is to preprocess the data and keep only one object for each group of duplicate objects. In this case, each neighbor can represent either a single object or a group of duplicate objects. 14. The following attributes are measured for members of a herd of Asian elephants: weight, height, tusk length, trunk length, and ear area . Based on these measurements, what sort of similarity measure from Section 2.4 would you use to compare or group these elephants? Justify your answer and ex-plain any special circumstances. Answer:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

Solutions1 - Assignment #1 Solutions 13. Consider the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online