Comments (6)
Looks like you have passed null
argument to the NearestNeighborModelEvaluator(PMML)
constructor. Have you double-checked it already?
JPMML-Evaluator works fine on Android. However, it may be a bit tricky to obtain the org.dmg.pmml.PMML
class model object, because you cannot parse PMML documents using the JAXB framework. The only option is to de-serialize it from a Java serialization document.
Have you seen the JPMML-Android project?
from jpmml-evaluator.
Sorry for the late reply but I've been testing out JPMML-Android. I've been looking over the code of JPMML-Android and I can not seem to find the part where you serialize the pmml file. How did you create the model.pmml.ser
file without using JAXBUtil.unmarshalPMML()
to generate the org.dmg.pmml.PMML
?
from jpmml-evaluator.
The model.pmml.ser
file is generated using org.jpmml:pmml-maven-plugin
Maven plugin, which is part of the JPMML-Model project. It happens during the packaging of the Android application APK.
Here's an example:
https://github.com/jpmml/jpmml-android/blob/master/pmml-android-example/pom.xml#L52
from jpmml-evaluator.
@vruusmann Thanks for the pointer. Any idea on whether it is possible to invoke this plugin in Android Studio/gradle instead of Maven? I understand that you can put a repo url in the top-level gradle file and import a maven library in the module-level gradle file, but I am not sure if the actual transformation defined by execution
can be performed using gradle.
Alternatively, do you have a pointer to a piece of code for transforming a model in PMML to SER?
from jpmml-evaluator.
@chenguangshen The SER
file is just a Java Serialization file:
org.dmg.pmml.PMML pmml = ...;
try(OutputStream os = new FileOutputStream("model.ser")){
ObjectOutputStream oos = new ObjectOutputStream(os);
oos.writeObject(pmml);
oos.close();
}
For more details, see the SerMojo
class that is part of the pmml-maven-module
of the JPMML-Model project:
https://github.com/jpmml/jpmml-model/blob/master/pmml-maven-plugin/src/main/java/org/jpmml/model/plugin/SerMojo.java#L192
from jpmml-evaluator.
@vruusmann Thanks, this is very helpful!
from jpmml-evaluator.
Related Issues (20)
- JPMML is enforcing the definition of target fields while the spec says it is optional HOT 6
- jpmml-evaluator does not handle null values when used in java? HOT 1
- Ability to run multiple JPMML-Evaluator versions in parallel (inside the same JVM) HOT 1
- NumberFormatException for evaluate "Random Survival Forest Model" generated by "SoftwareAG PMML Generator" HOT 3
- Compatibility with GraalVM HOT 12
- Not happy with XGBoost evaluation performance HOT 3
- How to load pre-transpiled PMML service provider JAR files? HOT 2
- Model verification fails for XGBoost models HOT 1
- No class def found for jakarta/xml/bind/JAXBContext HOT 3
- java.lang.IllegalArgumentException: Name cannot be empty HOT 1
- java.lang.NoClassDefFoundError: Could not initialize class org.jpmml.evaluator.FieldUtil HOT 4
- If the version 1.6.4 could work on java 8? HOT 1
- Field pmml(pred) is not defined. HOT 5
- DuplicatedFieldValueException after loading PMML in Java generated by Nyoka HOT 8
- 1.6.4 cannot run on java 8
- Exception: Required attribute `Segmentation@multipleModelMethod` is not defined HOT 3
- Updating Guava dependency to latest HOT 4
- why create jar file create error HOT 1
- LoadingModelEvaluatorBuilder not usable on Android due to "java.lang.NoClassDefFoundError: Failed resolution of: Ljava/awt/Image" HOT 2
- JavaError: org.jpmml.evaluator.UndefinedResultException: Undefined result HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpmml-evaluator.