[R] R svm prediction kernlab
kjkartik
kjkartik at gmail.com
Thu May 26 03:14:49 CEST 2011
Hi All,
I am using ksvm method in kernlab R package for support vector
machines. I learned the multiclass one-against-one svm from training data
and using it to classify new datapoints. But I want to update/finetune the
'svm weights' based on some criteria and use the updated svm weights in the
predict method framework. I don't know if its possible or not, how do
classify new data using predict method? Is it possible to build a new ksvm
object using new weights?
Weight calculation is as follows:
svp <- ksvm(x,y,type="C-svc", kernel="vanilladot",C=1)
w <- colSums(coef(svp)[[j]] * x[unlist(alphaindex(svp)[[j]]),])
b <- b(svp)[[j]]
for all j = 1:N(N-1)/2 where N is number of classes
Alternately, I implemented the majority voting myself to perform the
classification , but I am getting slightly different results from
predict.svm method for a case where I am not tuning the weights. I am not
sure if my implementation is correct or not. This was why I wanted to work
with predict method in first place. Please suggest.
thanks
gene
--
View this message in context: http://r.789695.n4.nabble.com/R-svm-prediction-kernlab-tp3551402p3551402.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list