1. Learn
  2. /
  3. Courses
  4. /
  5. Support Vector Machines in R

Exercise

Visualizing support vectors using ggplot

In this exercise you will plot the training dataset you used to build a linear SVM and mark out the support vectors. The training dataset has been preloaded for you in the dataframe trainset and the SVM model is stored in the variable svm_model.

Instructions

100 XP
  • Load ggplot2.
  • Plot the training dataset.
  • Mark out the support vectors on the plot using their indices from the SVM model.