[R] how to train ksvm with spectral kernel (kernlab) in caret?

From: Immanuel <mane.desk_at_googlemail.com>
Date: Sat, 28 May 2011 19:04:56 +0200


Hello all,

I would like to use the train function from the caret package to train a svm with a spectral kernel from the kernlab package. Sadly a svm with spectral kernel is not among the many methods in caret...

using caret to train svmRadial:



library(caret)
library(kernlab)

data(iris)
TrainData<- iris[,1:4]
TrainClasses<- iris[,5]

set.seed(2)
fitControl$summaryFunction<- Rand
svmNew<- train(TrainData, TrainClasses,

		method = "svmRadial",
		preProcess = c("center", "scale"),
		metric = "cRand",
		tuneLength = 4)

svmNew


here is an example on how to train the
ksvm with spectral kernel



# Load the data
data(reuters)
y <- rlabels
x <- reuters

sk <- stringdot(type="spectrum", length=4, normalized=TRUE) svp <- ksvm(x,y,kernel=sk,scale=c(),cross=5) svp


Does anyone know how I can train the svm from above with using the caret package?

best regards

        [[alternative HTML version deleted]]



R-help_at_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. Received on Sat 28 May 2011 - 17:12:19 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 28 May 2011 - 17:20:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive