Question: 8 . This problem involves the OJ data set which is part of the ISLR 2 package. ( a ) Create a training set containing
This problem involves the OJ data set which is part of the ISLR package.
a Create a training set containing a random sample of observations, and a test set containing the remaining observations.
b Fit a support vector classifier to the training data using cost 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 to
e Compute the training and test error rates using this new value for cost.
f Repeat parts b through e using a support vector machine with a radial kernel. Use the default value for gamma.
g Repeat parts b through e using a support vector machine with a polynomial kernel. Set degree
h Overall, which approach seems to give the best results on this data?
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
