Welcome to the technical support knowledge base for ADAPA on the Cloud. Our blogs cover general questions and information related to predictive models, PMML, and supported functionality of the ADAPA predictive decisioning platform. Please use the search tool or the FAQ Categories to the left to find the information you are looking for. If you can't find it, feel free to contact us.



© Predictive Analytics by Zementis, Inc. - All Rights Reserved.



Search This Blog

Loading...

Friday, February 8, 2008

What types of SVM models built with R ksvm can I export to PMML?


You can basically export any SVM models you build using the ksvm R package into PMML by using the PMML package available from Togaware.

The PMML package is also available from CRAN.



With this package, a PMML representation can be obtained for SVMs implementing:
  • multi-class classification

  • binary classifcation

  • regression
Note that it also implements transformations for the input variables by following the scaling scheme used by ksvm. It also uses transformations to create dummy variables for any categorical inputs.

We have encountered an issue with ksvm while building the dummy-fication piece. Basically, except for the first categorical variable in a model, all other categorical variables loose their first input category. That is, ksvm does not create a dummy variable for the first category. We have already pointed this out to the author of ksvm. For now, the PMML export code mimics this issue so that you can get a match during scoring.

The example below shows how to train a support vector machine to perform binary classification using the audit dataset provided by Togaware (thanks to Graham Williams).

require(kernlab)
audit <- read.csv(file("http://rattle.togaware.com/audit.csv")) myksvm <- ksvm(as.factor(Adjusted) ~ ., data=audit[,c(2:10,13)], kernel="rbfdot", prob.model=TRUE) pmml(myksvm, data=audit)


BTW, any models you build in ksvm and export using the PMML package can be uploaded directly into ADAPA for scoring.

0 comments:






Copyright © 2009 Zementis Incorporated. All rights reserved.

Privacy - Terms Of Use - Contact Us