jpmml / r2pmml

R library for converting R models to PMML
GNU Affero General Public License v3.0
73 stars 18 forks source link

How to choose PMML version? #71

Closed pinduzera closed 2 years ago

pinduzera commented 2 years ago

Hello! I wasn't able to find the option in the arguments, looking in the JAVA version I know that it does exist but couldn't find the argument/function.

How to choose a legacy PMML version? I'd like to use 4.2. (I know about renaming only, but this would be a great appeal on this package)

vruusmann commented 2 years ago

I wasn't able to find the option in the arguments,

The R2PMML package does not have such an option.

Perhaps you're confusing this package with the legacy pmml package (ref https://github.com/SoftwareAG/r-pmml/issues/7)?

How to choose a legacy PMML version?

Use some very old R2PMML package version. Something from 2015 or 2016 perhaps, when PMML schema version 4.3 didn't formally exist yet.

pinduzera commented 2 years ago

https://github.com/jpmml/jpmml-model In the first readme lines: "Full support for PMML 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 4.3 and 4.4 schemas: "

I guessed this would allow me to write to such versions.

vruusmann commented 2 years ago

"Full support for PMML 3.0, 3.1, 3.2, 4.0, 4.1, 4.2, 4.3 and 4.4 schemas"

Correct, the JPMML-Model library can losslessly represent PMML documents that use any of those schema versions. For example, you can read a PMML 3.0 document into memory, and write it back to a new PMML 3.0 document.

You are requesting a transformation operation between PMML schema versions ("make 4.4 into 4.2"). This is a completely different matter.

pinduzera commented 2 years ago

Humm, I think I've miss explained myself then.

My goal was just r2pmml(model, version = 4.2) Not really want to translate

But thanks for your patience anyway :)

vruusmann commented 2 years ago

My goal was just r2pmml(model, version = 4.2)

The R2PMML package does not support a version parameter. Never has, and probably never will.

See https://github.com/jpmml/r2pmml/issues/71#issuecomment-954932639

Not really want to translate

The latest R2PMML package version is generating PMML 4.4 documents. If you want to obtain an earlier PMML schema version document, then you need to perform a translation/transformation (ie. expressing 4.4-specific markup in terms of 4.2 markup).