K Nearest Neighbor
Problem 1 (15 points)
In this problem, you will implement a Distance-Weighted Nearest Neighbor Classifier and run it on a 2-dimensional dataset. (You can¡¯t use built-in knn functions in R to do this problem). You have to experiment with different distance measures and observe their influence on the classification performance.
The training data has two classes as shown in figure 1. The training set along with test points and their correct label are saved in knnData.csv.
Apply 3-NN and report your accuracy rate on test points for the following distance measures:
1. L2 norm 2. L1 norm 3. L¡Þ norm
Figure 1: The 2d training set
1