Hello, I'm trying to using ksvm() in the kernlab package to fit a one-class SVC, but I get a strage result on the cross-validation error estimate. For example, consider this code:
data(spam) classifier <- ksvm(type~.,data=spam[which(spam[,'type']=='spam'),], type="one-svc",kernel="rbfdot",kpar=list(sigma=0.1),nu=0.05,cross=10) what I get is: > classifier Support Vector Machine object of class "ksvm" SV type: one-svc (novelty detection) parameter : nu = 0.05 Gaussian Radial Basis kernel function. Hyperparameter : sigma = 0.1 Number of Support Vectors : 660 Objective Function Value : 10.5781 Training error : 0.212907 Cross validation error : 0 --- What surprises me is that the Training error (which I suppose is the resubstitution error) is higher than the cross-validation error. Also, even changing the value of sigma, the cross-validation error does not change. I get similar results with other datasets, too. For example classifier <- ksvm(Species~.,data=iris[which(iris[,'Species']=='setosa'),], type="one-svc",kernel="rbfdot",kpar=list(sigma=0.5),nu=0.05,cross=10) Am I using ksvm() correctly? I also tried to use the formula ~. exluding the attribute 'type' from the dataset, and the results are exactly the same. Unfortunately reading ?ksvm didn't help me much. thank you, regards, Roberto ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.