[R] Scaling in SVM

Steve Lianoglou mailinglist.honeypot at gmail.com
Wed Jul 13 22:53:55 CEST 2011


Hi Matthias,

On Wed, Jul 13, 2011 at 5:22 AM, Meffy <matthias.eder at dlr.de> wrote:
> Dear Community!
> I'm using the svm method of package e1071 for classifying my data. This
> really works fine, but however I have to work after creating the support
> vectors and the parameters with unscaled data. So the problem is when I try
> to train the classifier with the option "scale=F" the result is quite poor,
> so training with scaled data is essential. The rescaling of the support
> vectors is of course quite an easy task, but what about the parameters coefs
> and the summand rho? Are they influenced by the optimisation with scaled
> data (I think they have to...)? And is there any possiblility to rescale
> these values?
> I appreciate your help!

It's not surprising that your training results are better when you
scale your data.

I think instead of rescaling your output of your model, you might just
want to rescale any new data you are using with your SVM before you
apply your machine to it. If you want to be super strict, I guess you
would rescale your new data based on the values that were used in the
scaling of your original data.

You can see how this rescaling is done (based on the params of your
training data) by looking at the following function:

R> e1071:::predict.svm

Look for the `if(any(object$scaled))` block of code ...

HTH,
-steve

-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact



More information about the R-help mailing list