Learn R Programming

e1071 (version 1.3-16)

write.svm: Write SVM object to file

Description

This function exports an SVM object (trained by svm) to a specified file in the format that the function 'svm_load_model' of libsvm can read.

Usage

write.svm(object, file)

Arguments

object
Object of class "svm", created by svm.
file
filename to export the svm object to.

Details

This function is useful when SVM models trained in R shall be used in other environments.

See Also

svm

Examples

Run this code
data(iris)
attach(iris)

## classification mode
# default with factor response:
model <- svm (Species~., data=iris)

# export SVM object to file
write.svm(model, file="iris-classifier.svm")

Run the code above in your browser using DataLab