jpmml / jpmml-evaluator-spark

PMML evaluator library for the Apache Spark cluster computing system (http://spark.apache.org/)
GNU Affero General Public License v3.0
94 stars 43 forks source link

Can I use Scala to load PMML model to complete prediction? #42

Closed Afterall42 closed 2 years ago

Afterall42 commented 2 years ago

I built and saved the PMML model with Python, but I didn't know how to invoke it in scala and load it.

If possible, what functions should be used to read and call the PMML model

For example, I can use it in scala

val model = PipelineModel. load(”loadpath“)

Then use

model. transform(data)

To load the model

How do I write code if I want to load the PMML model

In readme It seems that the code in MD can only run in Java

vruusmann commented 2 years ago

How do I write code if I want to load the PMML model

See https://github.com/jpmml/jpmml-evaluator-spark#usage

In readme It seems that the code in MD can only run in Java

Scala is a subset of Java, right? You can use all JPMML-Evaluator-Spark APIs from Scala, simply replace type declarations with "var" or "val", and that's it.