How to use JPMML-Android to implement a PMML machine learning model?

心不动则不痛 提交于 2019-12-11 16:53:29

问题


I've created a PMML Random Forest model using scikit-learn in Python, and my goal is to implement that model in an Android app to do live predictions. From a previous question, the best way to go about this seemed to be using JPMML-Android (https://github.com/jpmml/jpmml-android). However, there's no tutorials, and given how new I am to this, I'm not sure at all what's going on in that 'Usage' section. Any help would be greatly appreciated on how I can use this to implement my model!

Thanks!


回答1:


  1. put your .pmml file in the directory:

jpmml-android-master\pmml-android-example\src\main\pmml\

  1. install the mvn plugin: e.g. in windows cmd:

mvn clean install

  1. find your .ser file in the directory:

jpmml-android-master\pmml-android-example\target\generated-sources\combined-assets\

The 2nd step compile the code and convert the .pmml file to .ser file.

Then you can follow the example code in

jpmml-android-master\pmml-android

to build the android project in Android Studio to use the .ser model.



来源:https://stackoverflow.com/questions/50399674/how-to-use-jpmml-android-to-implement-a-pmml-machine-learning-model

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