Tuning a linear SVM
In this exercise you will study the influence of varying cost on the number of support vectors for linear SVMs. To do this, you will build two SVMs, one with cost = 1 and the other with cost = 100 and find the number of support vectors. A model training dataset is available in the dataframe trainset.
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
Support Vector Machines in R
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
#build svm model, cost = 1
svm_model_1 <- svm(y ~ .,
data = ___,
type = "C-classification",
cost = ___,
kernel = "___",
scale = FALSE)
#print model details
___