Learn R Programming

pmml (version 1.2.21)

pmml.ksvm: Generate PMML for a ksvm object

Description

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.

Usage

## 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, dataset=NULL, \dots)

Arguments

model
a ksvm object.
dataset
the original dataset 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.

Details

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).

References

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

See Also

pmml. ksvm.

Examples

Run this code
# 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, dataset=ds)

Run the code above in your browser using DataLab