1

I am very new in both pmml and android field.I had follow the code in https://github.com/jpmml/jpmml-android/tree/master/pmml-android-example but EvaluatorUtil symbol cannot be resolved.So I follow suggestion in android and import org.jpmml.evaluator.EvaluatorUtil but now createEvaluator symbol cannot be resolved

.

private Evaluator createEvaluator() throws Exception { AssetManager assetManager = getAssets();

    try(InputStream is = assetManager.open("pmml.pmml.ser")){
        return EvaluatorUtil.createEvaluator(is);
    }
}
Yiyi Niw
  • 13
  • 3
  • You have to import the library following the instructions in the [repo](https://github.com/jpmml/jpmml-android). – Gabriele Mariotti Aug 28 '19 at 09:52
  • Thanks....I had already run mvn clean install...if i use jar,then there is a warning([WARNING] JAR will be empty - no content was marked for inclusion! )but if i changed jar to pom, then there is no any warning occurred.I think I already followed the steps in repo....I am very new in android,sorry for any mistake...thanks – Yiyi Niw Aug 28 '19 at 11:02
  • I had download the zip and put the zip in libs folder.Then add the library(zip) in project structure.I had not sure that this step successfully add the library to my project?Thanks – Yiyi Niw Aug 28 '19 at 11:05
  • Any specific reason this is tagged "rapidminer"? – Christian König Aug 28 '19 at 12:45
  • @ChristianKönig I import the pmml model from rapidminer....I am not sure whether there is any effect on my mistake – Yiyi Niw Aug 28 '19 at 13:21

1 Answers1

0

If you use gradle you need to import library like this in your app gradle file :

implementation group: 'org.jpmml', name: 'jpmml-evaluator-spark', version: '1.0.0'

then Sync and it's all :)

Kévin Giacomino
  • 487
  • 4
  • 11
  • Thanks, I had try with this idea but it still can't worked for me.Cannot resolve method 'createEvaluator(java.io.InputStream).Do you have any idea?thanks so much....I will try all out – Yiyi Niw Aug 28 '19 at 10:53
  • Did you import org.jpmml.evaluator.spark.EvaluatorUtil; in your class ? – Kévin Giacomino Aug 28 '19 at 11:37
  • After adding import org.jpmml.evaluator.spark.EvaluatorUtil; There is an error: cannot access JAXBException class file for javax.xml.bind.JAXBException not found...May I know how can I solved this? – Yiyi Niw Aug 28 '19 at 13:32
  • Could you try to add implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1' in your app gradle ? – Kévin Giacomino Aug 28 '19 at 13:37
  • Thanks...yup....I tried it and this problem is solved but currently gt this error ( com.google.android.apps.gsa.shared.speech.b.g: Error reading from input stream) Is that the system cannot read my pmml file ? or?Application can run but the evaluation result didnt coming out – Yiyi Niw Aug 29 '19 at 09:23
  • Maybe your file is empty or corrupted.. do you have more information about the error in your log cat ? – Kévin Giacomino Aug 29 '19 at 09:49
  • the error in logcat too long..can't post here...can I have your email....I can send the code to you...If u dunt mind or I attached my email here?.Thanks..if i use jar,then there is a warning([WARNING] JAR will be empty - no content was marked for inclusion! )but if i changed jar to pom, then there is no any warning occurred.Currently i put pom for my packaging to avoid the warning...Does it have any effect to this problem?Thanks – Yiyi Niw Aug 29 '19 at 13:22