In this example, we will use a text classification model to define a linear SVM model. Unstructured text data is a perfect way to illustrate SVM since the data is very high dimensional.
To illustrate SVM classifiers, we will begin by reading in some consumer complaint data regarding student loans. We will be using two packages, e1071 and RTextTools:
install.packages("e1071") install.packages("RTextTools") library(e1071) library(RTextTools)
Begin by loading the data from the CSV file. The data frame simply consists of some consumer narrative regarding student loans, along with how the complaint was classified. The goal is to develop a SVM model which will classify future customer complaints into ...