Question: y 4 0 1 [6 points] Classification using KNN. The table below provides a training dataset containing six observations (a.k.a. samples) (n = 6) each

 y 4 0 1 [6 points] Classification using KNN. The table

y 4 0 1 [6 points] Classification using KNN. The table below provides a training dataset containing six observations (a.k.a. samples) (n = 6) each with three predictors (a.k.a features) (p = 3), and one qualitative response variable (a.k.a. target). Table 1. Training dataset with n = 6 observations in p = 3 dimensions with a categorical response, y Obs. * x2 *) 1 O 3 Red 2 2 0 0 Red 3 0 1 3 Red 2 Blue 5.1 0 1 Blue 6 1 1 1 Red We want to use the above training dataset to make a prediction, 9, for an unlabeled test data observation where x1 = x2 = x3 = 0 using K-nearest neighbors. You are given some code below to get you started. Note: coding is only required for part (a), for (1)-(d) please provide your reasoning based on your answer to part (a). (a) Compute the Euclidean distance between each observation and the test point, x1 = x2 = x3 = 0. Present your answer in a table similar in style to Table 1 with observations 1-6 as the row headers. (b) What is our prediction, 9, when K = 1 for the test point? Why? le) What is our prediction, 9, when K = 3 for the test point? Why? (d) If the Bayes decision boundary (the optimal decision boundary) In this problem is highly nonlinear, then would we expect the best value of K to be large or small? Why? import numpy as np X = np.array([[ 8, 3, 01, [ 2, , 0], [ 0, 1, 31, [ 0, 1, 21, [-1, , 1), [ 1, 1, 111) y = np.array( 'r',r,'r ','b', 'r'])

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!