Session Ready
Exercise

Building and visualizing the tuned model

In the final exercise of this chapter, you will build a polynomial SVM using the optimal values of the parameters that you obtained from tune.svm() in the previous exercise. You will then calculate the training and test accuracies and visualize the model using svm.plot(). The e1071 library has been preloaded and the test and training datasets are available in the dataframes trainset and testset. The output of tune.svm() is available in the variable tune_out.

Instructions
100 XP
  • Build an SVM using a polynomial kernel of degree 2.
  • Use the optimal parameters calculated using tune.svm().
  • Obtain training and test accuracies.
  • Plot the decision boundary against the training data.