How to do it...

Perform the following steps to train the SVM:

  1. Load the e1071 package:
        > library(e1071)
  1. Train the support vector machine using the svm function with trainset as the input dataset and use churn as the classification category:
        > model  =svm(churn~., data = trainset, kernel="radial", cost=1, 
gamma = 1/ncol(trainset))
  1. Finally, you can obtain overall information about the built model with summary:
        > summary(model)
        Output
        Call:
        svm(formula = churn ~ ., data = trainset, kernel = "radial",
cost = 1, gamma = 1/ncol(trainset))
Parameters: SVM-Type: C-classification SVM-Kernel: radial cost: 1 gamma: 0.05882353 Number of Support Vectors: 691 ( 394 297 ) Number of Classes: 2 Levels: yes no
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset