jpmml / jpmml-lightgbm

Java library and command-line application for converting LightGBM models to PMML
GNU Affero General Public License v3.0
174 stars 58 forks source link

Failed to convert GBDT to PMML #57

Closed StephanieWang closed 2 years ago

StephanieWang commented 2 years ago

Hello, When i convert lightgbm model to pmml, the script is failing with an exception as follows:

Failed to convert GBDT to PMML
java.lang.IllegalArgumentException
        at org.jpmml.lightgbm.GBDT.encodeSchema(GBDT.java:296)
        at org.jpmml.lightgbm.GBDT.encodePMML(GBDT.java:383)
        at org.jpmml.lightgbm.Main.run(Main.java:167)
        at org.jpmml.lightgbm.Main.main(Main.java:136)

Exception in thread "main" java.lang.IllegalArgumentException
        at org.jpmml.lightgbm.GBDT.encodeSchema(GBDT.java:296)
        at org.jpmml.lightgbm.GBDT.encodePMML(GBDT.java:383)
        at org.jpmml.lightgbm.Main.run(Main.java:167)
        at org.jpmml.lightgbm.Main.main(Main.java:136) 

the command is :

java -jar jpmml-lightgbm-executable-1.3.6.jar --lgbm-input lightgbm.txt --pmml-output lightgbm_1.pmml

It was working fine before, but the last few days have this problem. What can i do to fix it? Thanks very much!

vruusmann commented 2 years ago

When i convert lightgbm model to pmml, the script is failing with an exception as follows

Looks like an issue with the encoding of categorical features: https://github.com/jpmml/jpmml-lightgbm/blob/1.3.6/src/main/java/org/jpmml/lightgbm/GBDT.java#L296

It was working fine before, but the last few days have this problem.

The behaviour of JPMML-family command-line applications DOES NOT CHANGE in time. All binary releases are frozen and immutable.

The most likely explanation is that your base LightGBM installation has been updated/upgraded.

vruusmann commented 2 years ago

Also - please upgrade - JPMML-LightGBM version 1.3.6 was released more than a year ago.

I don't provide software archaeology services.