简体   繁体   中英

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

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. put your .pmml file in the directory:

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

  1. install the mvn plugin: eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM