[R] TR: [e1071] Load an SVM model exported with write.svm

Alekseiy Beloshitskiy abeloshitskiy at velti.com
Tue Apr 3 14:17:36 CEST 2012


Hello, Alexandre,

In R you can specify whether to use or not scaling with parameter scale, e.g.:
model<-svm(class_var ~ ., data=trainset, scale=FALSE);

Don't forget to disable it if you already sclaed your data with libsvm svm-scale algorithm.


Best,
-Alex
________________________________________
From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] on behalf of Alexandre Marié [alexandre.marie at artelys.com]
Sent: 29 March 2012 13:22
To: r-help at r-project.org
Subject: [R] TR: [e1071] Load an SVM model exported with write.svm

Dear R help mailing list,



I work on a project using the SVM implementation from e1071 R package and I
really need your help in order to use correctly the write.svm function.



I trained my SVM model in R and I would like to use this model in Java. To
do that, I would like to use the libsvm Java version (I tried to used
jlibsvm, in order to benefit from the refactoring, but it does not seem to
work and the lack of documentation push me to switch to the libsvm java
version).



Thus, I exported my model with the function write.svm and import it with the
libsvm java library but I didn’t obtain the expected result from my test
data set. I suspect that the load of the model file is not enough and it is
necessary to use the .scale file, in Java, to scale the data (I suspect that
the model object in R contains the scaling) but I don’t know how to do that.



In order to understand how it is working, I would like, in the first place,
load the file generated by write.svm in R in order to be sure the model in
the file match with my R object. But I don’t find any function to load that
kind of file.



How could I load a model file generated by write.svm in R?



Thanks a lot in advance for your help!



Best regards,



  _____

Alexandre Mariι
Artelys : www.artelys.com




        [[alternative HTML version deleted]]






More information about the R-help mailing list