調校 RBF kernel 的 SVM
在這個練習中,你會為給定的訓練資料集(在資料框 trainset 中)建立一個已調校的 RBF kernel SVM,並在測試資料集(在資料框 testset 中)上計算準確率。接著,你會將調校後的決策邊界與測試資料集一起繪製出來。
本練習屬於課程
R 的支援向量機
動手互動練習
試著完成這個範例程式碼,體驗一下這個練習。
#tune model
tune_out <- ___(x = trainset[, -3], y = trainset[, 3],
gamma = 5*10^(-2:2),
cost = c(0.01, 0.1, 1, 10, 100),
type = "C-classification", kernel = ___)