R Data Analysis Cookbook, Second Edition - Second Edition
by Kuntal Ganguly, Davor Lozić, Mzabalazo Z. Ngwenya, Andrew Bauman, Shanthi Viswanathan, Viswa Viswanathan
How it works...
The SVM builds a highly accurate model through kernel trick, by mapping nonlinear data to higher-dimension space, where the data can be more easily separated with a linear boundary or hyperplanes that maximize the margin width among different classes. It avoids overfitting by making use of regularization and in general does not suffer from local optima or multicollinearity.
The svm function determines the type of model (classification or regression) based on the nature of the outcome variable. When the outcome variable is a factor, svm builds a classification model. At a minimum, we need to pass the model formula and the dataset to use as arguments. (Alternately, we can pass the outcome variable and predictor variables separately ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access