{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw1_soln - CS 478 Machine Learning Homework 1 Suggested...

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 478 Machine Learning: Homework 1 Suggested Solutions 1 kNN Decision Boundaries (a) (b) (c) It would be classified as ‘circle’. Adding one point is enough, say a ‘cross’ at exactly (1,-1). (d) It would be classified as ‘circle’. The five closest points are (0 , 0) , (2 , 0) , (1 , - 3) , (3 , - 2) , (0 , 1). The forth and fifth closest point (3 , - 2) , (0 , 1) are equidistant to (1 , - 1), and of dif- ferent classes. So if we break ties by picking crosses (the point (0,1)), then only one point is needed, say a cross at (1,-1). Otherwise if we break tie by picking the circle then we need at least two points (two crosses at (1,-1), say). 1
Image of page 1

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

View Full Document Right Arrow Icon
2 kNN Implementation (a) Always predict the majority class. The baseline accuracy for the Wine dataset is 0.3077, while that for the Liver dataset is 0.6145. (b) See the plots below: The best value of k for the Wine dataset is 7, while that for the Liver dataset is 7 or 13. (c) It might be useful because the input features could have been measured in differ- ent units of varying scales, say, some measured in centimetres while some measured in metres. Assuming those features have similar importance towards classification, the kNN algorithm would give more weight to features with larger range since they contribute more to the Euclidean distance. Rescaling the features with mean and standard deviation could eliminate some of these undesirable effects. 2
Image of page 2
(d) See plots below: Standardization improves the performance on the Wine dataset across a whole range of values of k while harms the performance on the Liver dataset.
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern