Question: 5 . For problem 4 , instead of implementing validation set approach, proceed to use leave - one - out cross - validation ( function
For problem instead of implementing validation set approach, proceed to use leave oneout crossvalidation function knncv Run it for K and compare the resulting CV errors. Use all observations of Auto data set for relevant pre dictors, not just the training subsetas we are not doing any traintest subdivision here
a Run set.seed command prior to each cvknn call, for uniformity of the re sults.
b First do it for data in its original form as you had in d no scaling What are the test errors? Which method wins? Show the code for just one of K values eg K
c Then do it for scaled data as you had in e What are the test errors? Which method wins? Show the code for just one of K values eg K
d Which results should we trust more validation set approach from problem Or CV results here? Why?
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
