[R] different leave-one-out cross-validation results from tune.svm(...) and svm(...)

From: Wolfgang Meyer <wolfgang.meyer_at_gmail.com>
Date: Tue 16 Aug 2005 - 22:23:48 EST


I am currently using the svm functions from R package e1071 (1.5-9). I use function tune.svm(...) to tune the parameters for SVM with RBF kernel. To obtain reproducible tuning results, I chose leave-one-out cross-validation (LOOCV) as my perfomance measurement.

> tune.rlt <- tune.svm(classes~., data = data.frame(features, classes),

                                 gamma = 2^(-12:0),
                                 cost = 2^(0:12),
                                 tunecontrol = tune.control(cross =

With this LOOCV scheme I obtained certain best performance with tuned parameters (gamma1, cost1). Let's assume the best error estimation in tune.rlt is E.

Then I trained a SVM with these parameters (gamma1 & cost1). I also ask it to return LOOCV results:

> svm.rlt <- svm(classes~., data = data.frame(features, classes),

                        gamma=gamma1, cost=cost1, 

And I obtain LOOCV accuracy from svm.rlt, let's assume it is A.

Unfortunately, it is usually the case that

E+A < 100%
(it is not numerical error)

Since I used LOOCV as the perfomance measurement, I suppose

E+A =100%

Why is this the case?

Wolfgang Meyer

R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Aug 16 22:29:46 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:23:23 EST