O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Tuning the SVM

The SVM provides a tune.svm function that allows us to tune its performance by adjusting the gamma and cost argument. After retrieving the best performance parameters from a summary of the tuned output, we can retrain the SVM with those parameters to enhance the model accuracy and efficiency:

> tuned = tune.svm(class ~ ., data = bn[t.idx,], gamma = 10^(-6:-1),cost = 10^(1:2))> summary(tuned)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required