Question: Instantiate a KNN object with K = 3 , train it on the training set and test it on the testing set. Then, calculate the

Instantiate a KNN object with K=3, train it on the training set and test it on the testing set. Then, calculate the accuracy of your prediction as you learned in Lab3.
Repeat part (c) for K=1, K=3, K=5, K=11, K=15, K=27, K=43(you can simply use a for loop, and save the final accuracy results in a list). Does the accuracy always get better by increasing the value K?

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 Programming Questions!