Solutions1

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

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

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.

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern