Question: 23 Consider again the table given in question 21 with T points of X and Y where Y is a categorical variable taking values i]


23 Consider again the table given in question 21 with T points of X and Y where Y is a categorical variable taking values i] [Negative] or 1 (Positive). a} (5 points] Implement the Knearest neighbors [KNN] algorithm for K=l, K=3, and K=5. Write your classication values for each X value [-3J2,..., 2, 3} under the line as U or 1. The Y values in the data are shown by the colored dois where the blue dots are Y=D and red dots are Y=l. X-3-2-1D123 h} [2 points) Construct the confusion matrix for each K=1, 3, 5. Among K=3 and K=5, which one has the smallest error rate
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
