4

Short question: is there a PMML interface for Java, Python or any other major programming language that supports SVM models?

Background: I have trained an SVM model in R using the ksvm function from the kernlab package. Now I would like to use this model in a different piece of software. To export it from R, I think I could use PMML (Predictive Model Markup Language) via the pmml package for R.

However, I can't find any library for Java, Python, or basically any language that allows for importing such a model. The Data Mining Group lists quite a few PMML interfaces, but these are mostly specific tools for statistics. There is also the libsvm general library, but it is not clear how this can be used to migrate models from one to another interface.

roelandvanbeek
  • 659
  • 8
  • 20

5 Answers5

1

You can import the model you trained in any language. There is an example for Python Reinitializing learned linear models with scikit-learn

Community
  • 1
  • 1
Bilal Dadanlar
  • 820
  • 7
  • 14
0

You could use the Zementis ADAPA scoring engine to deploy your model and them access it through web-services. From my experience, ADAPA is also available as a Java library and so you can code against its Java API. Hope this helps.

user2262875
  • 121
  • 2
  • This Java library sounds like it is exactly what I'm looking for. However, I can't find anything about it on the internet; it looks as if ADAPA is only offered as a web service. Do you have more information? – roelandvanbeek Apr 10 '13 at 09:45
0

A library called "Pattern" translates PMML models into Cascading apps in Java. Then you can run model scoring on Hadoop or within other Java apps. https://github.com/Cascading/pattern

There's a SVM impl for Pattern -- being rewritten for the latest update to the library. Check on the developer email list: https://groups.google.com/forum/?fromgroups#!forum/pattern-user

Paco
  • 602
  • 1
  • 9
  • 19
  • Correct me if I'm wrong, but it seems that the Cascading apps are only for scoring models, which I can also do in R. I want to write an application using the model. – roelandvanbeek Jun 06 '13 at 08:28
0

You can use Weka both as an Java API or as standalone tool, which works well for PPML with some classifiers. Check these classes in weka API: weka.classifiers.pmml.consumer.PMMLClassifier and weka.classifiers.pmml.consumer.SupportVectorMachineModel.

0

I believe the JPMML (Java Evaluator PMML API) will do what you want.