roelandvanbeek
roelandvanbeek

Reputation: 669

Import an SVM model in PMML to Java or Python?

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.

Upvotes: 4

Views: 2670

Answers (5)

user6253481
user6253481

Reputation: 13

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

Upvotes: 0

Ícaro Dourado
Ícaro Dourado

Reputation: 51

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.

Upvotes: 0

Bilal Dadanlar
Bilal Dadanlar

Reputation: 820

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

Upvotes: 1

Paco
Paco

Reputation: 666

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

Upvotes: 0

user2262875
user2262875

Reputation: 121

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.

Upvotes: 0

Related Questions