Question
Consider the training and test data posted on eLearning in the files 1-tranining-data.csv and 1-test-data.csv, respectively, for a classification problem with two classes. (a) Fit
Consider the training and test data posted on eLearning in the files 1-tranining-data.csv and 1-test-data.csv, respectively, for a classification problem with two classes.
(a) Fit KNN with K = 1, 6, . . . , 200.
(b) Plot training and test error rates against K. Explain what you observe. Is it consistent with what you expect from the class?
(c) What is the optimal value of K? What are the training and test error rates associated with the optimal K?
(d) Make a plot of the training data that also shows the decision boundary for the optimal K. Comment on what you observe.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started