[R] SVM module: scaling data applied to new test set without using SVMagain
David Meyer
david.meyer at ci.tuwien.ac.at
Fri Apr 4 19:59:04 CEST 2003
seidel at micro-biolytics.com wrote:
>
> Hello!
>
> We are new in using R. We use the SVM module from the library 'e1071'
> for training.
>
> Problem formulation:
>
> a classification has been performed using SVM module (linear kernel).
> Later, a new data set (test set) comparable to the training data shall be
> scaled in the same way as the training set (using the same scaling
> parameter set, but without using the SVM again to save time). We found the
> scaling matrices, but we do not know, how to apply them.
[note: in the `x.scale' element of the fitted model]
>
> How must the scaling parameter matrices (scaled:center and scaled:scale)
> be applied to the test data set to receive the same scaling as it would
> have been done by the SVM module?
the function `scale' has two parameters: `center' and `scale'.
So, you could do sth. like:
scale(newdata,
center = model$x.scale$"scaled:center",
scale = model$x.scale$"scaled:scale")
best,
David
>
> Thanx very much in advance!
> [[alternate HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
--
Mag. David Meyer Wiedner Hauptstrasse 8-10
Vienna University of Technology A-1040 Vienna/AUSTRIA
Department of Tel.: (+431) 58801/10772
Statistics and Probability Theory Fax.: (+431) 58801/10798
More information about the R-help
mailing list