Question: using rstudio 6. This problem involves the OJ data set which is part of the ISLR package. (a) Use set.seed(1). Create a training set containing

using rstudio
6. This problem involves the OJ data set which is part of the ISLR package. (a) Use set.seed(1). Create a training set containing a random sample of 800 obser- vations, and a test set containing the remaining observations. (b) Fit a support vector classifier to the training data using cost = 0.01, with Purchase as the response and the other variables as predictors. Use the summary function to produce summary statistics, and describe the results obtained. (c) What are the training and test error rates? (d) Use the tune() function to select an optimal cost. Consider values in the range 0.01 to 10 (close to how we did in the lab). (e) Compute the training and test error rates using this new value for cost. 6. This problem involves the OJ data set which is part of the ISLR package. (a) Use set.seed(1). Create a training set containing a random sample of 800 obser- vations, and a test set containing the remaining observations. (b) Fit a support vector classifier to the training data using cost = 0.01, with Purchase as the response and the other variables as predictors. Use the summary function to produce summary statistics, and describe the results obtained. (c) What are the training and test error rates? (d) Use the tune() function to select an optimal cost. Consider values in the range 0.01 to 10 (close to how we did in the lab). (e) Compute the training and test error rates using this new value for cost
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
