如何使用JPMML-Android实现PMML机器学习模型? [英] How to use JPMML-Android to implement a PMML machine learning model?

查看:623
本文介绍了如何使用JPMML-Android实现PMML机器学习模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Python中使用scikit-learn创建了PMML随机森林模型,我的目标是在Android应用中实现该模型以进行实时预测.从上一个问题开始,解决此问题的最佳方法似乎是使用JPMML-Android( https://github.com/jpmml/jpmml-android ).但是,这里没有教程,而且鉴于我对此有何新意,我不确定该用法"部分中发生了什么.我将如何使用它来实现我的模型,对您的任何帮助将不胜感激!

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!

谢谢!

推荐答案

  1. 将.pmml文件放入目录:

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

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

  1. 安装mvn插件:例如在Windows cmd中:

mvn全新安装

mvn clean install

  1. 在目录中找到您的.ser文件:

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

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

第二步,编译代码并将.pmml文件转换为.ser文件.

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

然后,您可以按照

jpmml-android-master \ pmml-android

jpmml-android-master\pmml-android

在Android Studio中构建android项目以使用.ser模型.

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

这篇关于如何使用JPMML-Android实现PMML机器学习模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆