[R] SVM module: scaling data applied to new test set without using SVMagain
david.meyer at ci.tuwien.ac.at
Fri Apr 4 19:59:04 CEST 2003
seidel at micro-biolytics.com wrote:
> 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:
center = model$x.scale$"scaled:center",
scale = model$x.scale$"scaled:scale")
> Thanx very much in advance!
> [[alternate HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
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