- Hands-On Ensemble Learning with R
- Prabhanjan Narayanachar Tattar
- 124字
- 2025-04-04 16:30:55
Support vector machines
Support vector machines, abbreviated popularly as SVM, are an important class of machine learning techniques. Theoretically, SVM can take an infinite number of features/covariates and build the appropriate classification or regression SVMs.
SVM for hypothyroid classification
The svm
function from the e1071
package will be useful for building an SVM
classifier on the Hypothyroid dataset. Following the usual practice, we have the following output in the R session:
> SVM_fit <- svm(HT2_Formula,data=HT2_Train) > SVM_predict <- predict(SVM_fit,newdata=HT2_TestX,type="class") > SVM_Accuracy <- sum(SVM_predict==HT2_TestY)/nte > SVM_Accuracy [1] 0.9842767296
The SVM technique gives us an accuracy of 98.43%, which is the second best of the models set up thus far.
In the next section, we will run each of the five classification models for the Waveform, German Credit, Iris, and Pima Indians Diabetes problem datasets.