From 0cce1a2e131612a213247051a014e363ad0bdaa3 Mon Sep 17 00:00:00 2001 From: "xuanyi.wang" Date: Mon, 22 May 2023 21:25:29 +0200 Subject: [PATCH] Update page 'Solutions to the questions concerning R language' --- Solutions to the questions concerning R language.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Solutions to the questions concerning R language.md b/Solutions to the questions concerning R language.md index 84913d1..7e8d9ba 100644 --- a/Solutions to the questions concerning R language.md +++ b/Solutions to the questions concerning R language.md @@ -219,8 +219,7 @@ table(OJ.test$Purchase, test.pred) The radial basis kernel with default gamma creates 367 support vectors, out of which, 184 belong to level `𝙲𝙷` and remaining 183 belong to level `𝙼𝙼`. The classifier has a training error of 14.7% and a test error of 15.6% which is a slight improvement over linear kernel. We now use cross validation to find optimal gamma. ``` set.seed(755) -tune.out = tune(svm, Purchase ~ ., data = OJ.train, kernel = "radial", ranges = list(cost = 10^seq(-2, - 1, by = 0.25))) +tune.out = tune(svm, Purchase ~ ., data = OJ.train, kernel = "radial", ranges = list(cost = 10^seq(-2, 1, by = 0.25))) summary(tune.out) ``` ```