Update page 'Questions concerning R language'

xuanyi.wang
2023-05-22 20:39:57 +02:00
parent e8ea8c2dae
commit 08dbdc253e
+8 -8
@@ -1,14 +1,14 @@
***Applied Question*** ***Applied Question***
This problem involves the `OJ` data set which is part of the `ISLR` package. This problem involves the `OJ` data set which is part of the `ISLR` package.
* Create a training set containing a random sample of 800 observations, and a test set containing the remaining observations. > i. Create a training set containing a random sample of 800 observations, and a test set containing the remaining observations.
* 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. > ii. 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.
* What are the training and test error rates? > iii. What are the training and test error rates?
* Use the `tune()` function to select an optimal cost. Consider values in the range 0.01 to 10. > iv. Use the `tune()` function to select an optimal cost. Consider values in the range 0.01 to 10.
* Compute the training and test error rates using this new value for `cost`. > v. Compute the training and test error rates using this new value for `cost`.
* Repeat parts (ii) through (v) using a support vector machine with a radial kernel. Use the default value for `gamma`. > vi. Repeat parts (ii) through (v) using a support vector machine with a radial kernel. Use the default value for `gamma`.
* Repeat parts (ii) through (v) using a support vector machine with a polynomial kernel. Set `degree=2`. > vii. Repeat parts (ii) through (v) using a support vector machine with a polynomial kernel. Set `degree=2`.
* Overall, which approach seems to give the best results on this data? > viii. Overall, which approach seems to give the best results on this data?
***Conceptual Question*** ***Conceptual Question***