Skip to content

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

1 message · Wolfgang Meyer

#
Hi, 

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.
gamma = 2^(-12:0),
                                 cost = 2^(0:12),
                                 tunecontrol = tune.control(cross =
length(cls)))

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:
gamma=gamma1, cost=cost1, 
                        cross=length(classes))

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?