pmml.ksvm {pmml} | R Documentation |
Generate the PMML representation for a ksvm object (SVM). The PMML can then be imported into other systems that accept PMML. With this code, a PMML representation can be obtained for SVMs implementing classification (multi-class and binary) as well as regression.
## S3 method for class 'ksvm': pmml(model, model.name="SVM_model", app.name="Rattle/PMML", description="Support Vector Machine PMML Model", copyright=NULL, transforms=NULL, data.name, ...)
model |
a ksvm object. |
data.name |
the name of the data object used to train the SVM model in ksvm - required since the ksvm object does not appear to record information about the used categorical variables. |
model.name |
a name to give to the model in the PMML. |
app.name |
the name of the application that generated the PMML. |
description |
a descriptive text for the header of the PMML. |
copyright |
the copyright notice for the model. |
transforms |
a coded list of transforms performed. |
... |
further arguments passed to or from other methods. |
The generated PMML can be imported into any PMML consuming application that recognizes PMML 3.2. An example is ADAPA (Adaptive Decision and Predictive Analytics), a lightweight decision engine with batch and real-time scoring of predictive models (also supporting neural networks and linear and logistic regression).
Package home page: http://rattle.togaware.com
PMML home page: http://www.dmg.org
Zementis' useful PMML convert: http://www.zementis.com/pmml_converters.htm
ADAPA home page: http://www.zementis.com/adapa.htm
# Train a support vector machine to perform binary classification. require(kernlab) data(spam) index <- sample(1:dim(spam)[1]) ds <- spam[index[1:300],] # For illustration only use a small dataset. fit <- ksvm(type~., data=ds, kenrel="rbfdot") # Genetate the PMML. pmml(fit, data=ds)