เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Building a linear SVM classifier

In this exercise, you will use the svm() function from the e1071 library to build a linear SVM classifier using training dataset you created in the previous exercise. The training dataset has been loaded for you in the dataframe trainset

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Support Vector Machines in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Load the e1071 library.
  • Build an SVM model using a linear kernel.
  • Do not scale the variables (this is to allow comparison with the original dataset later).

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

library(___)

#build svm model, setting required parameters
svm_model<- svm(y ~ ., 
                data = ___, 
                type = "C-classification", 
                kernel = "___", 
                scale = ___)
แก้ไขและรันโค้ด