jpmml / r2pmml

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

Changes in new ranger version #62

Closed mnwright closed 4 years ago

mnwright commented 4 years ago

r2pmml now fails on CRAN because we made some changes to the internal data structure in ranger. We now have separate X and Y data instead of one combined data structure.

My guess is you have to change

Feature feature = schema.getFeature(splitVarIndex - 1);

to

Feature feature = schema.getFeature(splitVarIndex);

in RangerConverter.java, line 295. But I cannot test because I don't know how to compile the Java part in your package.

If you want to keep compatibility with old versions, you could check for existence of forest$dependent.varID, which does not exist anymore in the new versions, see e.g. here: https://github.com/imbs-hl/ranger/blob/dfa696fe82572ccef8c68d2762bbe2d88aa87b6c/R/predict.R#L109

vruusmann commented 4 years ago

If you want to keep compatibility with old versions, you could check for existence of forest$dependent.varID

I sure want to keep compatibility with old ranger versions - thanks for the hint!

@mnwright Is this issue blocking your work in any way? Perhaps you want to push out a new version of the ranger package, and CRAN reviewers won't let you do it because it appears to break the downstream r2pmml package?

mnwright commented 4 years ago

No blocking on my side. The new ranger version is already on CRAN and as Brian Ripley wrote in the email:

Please resolve amongst yourselves ASAP.