[R] R svm prediction kernlab

From: kjkartik <kjkartik_at_gmail.com>
Date: Wed, 25 May 2011 18:14:49 -0700 (PDT)

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.


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.

R-help_at_r-project.org mailing list
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 26 May 2011 - 01:23:24 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 Thu 26 May 2011 - 03:40: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