问题
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\
- install the mvn plugin: e.g. in windows cmd:
mvn clean install
- 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