Import an SVM model in PMML to Java or Python?

时光总嘲笑我的痴心妄想 提交于 2019-12-23 12:35:59

问题


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.


回答1:


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




回答2:


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.




回答3:


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




回答4:


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.




回答5:


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



来源:https://stackoverflow.com/questions/15874969/import-an-svm-model-in-pmml-to-java-or-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!