pmml.ksvm {pmml} | R Documentation |
Generate the PMML representation for a ksvm object from package kernlab.
## 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, unknownValue=NULL, dataset=NULL, ...)
model |
a ksvm object. |
model.name |
a name to be given to the model in the PMML code. |
app.name |
the name of the application that generated the PMML code. |
description |
a descriptive text for the Header element of the PMML code. |
copyright |
the copyright notice for the model. |
transforms |
data transformations represented in PMML via package pmmlTransformations. |
unknownValue |
value to be used as the 'missingValueReplacement' attribute for all MiningFields. |
dataset |
required since the ksvm object does not record information about the used categorical variable; the original dataset used to train the SVM model in ksvm. |
... |
further arguments passed to or from other methods. |
Both classification (multi-class and binary) as well as regression cases are supported.
Zementis Inc. info@zementis.com
R project CRAN package: kernlab: Kernel-based Machine Learning Lab
http://cran.r-project.org/web/packages/kernlab/index.html
# Train a support vector machine to perform classification. library(kernlab) model <- ksvm(Species ~ ., data=iris) p <- pmml(model, dataset=iris) # To make predictions using this model, the new data must be given; without it and by # simply using the "predict" function without an input dataset, the predicted value # will not be the true predicted value. It will be a raw predicted value which must be # post-processed to get the final correct predicted value # # Make predictions using same iris input data. Even though it is the same dataset, it # must be provided as an input parameter for the "predict" function. predict(model,iris[,1:4]) rm(model) rm(p)