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

Info iconThis 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
Background image of page 1

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

View Full DocumentRight 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
Background 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. (e)
Background image of page 3

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

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

Page1 / 7

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

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

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