June 2017
Beginner to intermediate
576 pages
15h 22m
English
Support vector machines (SVM) can also be used to predict a binary class. SVM projects the data into a higher dimensional space so that hyperplanes can be used to separate the classifiers. SVMs can be very accurate but difficult to interpret and computationally expensive. They are a classic example of a low bias algorithm.
Here is a simple example of using an SVM to predict whether a person is satisfied based upon the day of the week and whether or not it is a payday. (The vector element is marked as 1 in the payday vector, which can be interpreted as Friday if you start counting from Sunday.)
library(e1071) satisfied = factor(c(F,F,F,F,F,T,F)) day = c(1,2,3,4,5,6,7) payday = c(0,0,0,0,0,1,0) satisfaction.df ...