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

Not able to get categorical features map in pmml file while creating one from lightgbm model (v1.2) #54

Closed arpitswami closed 2 years ago

arpitswami commented 2 years ago

Hi,

I am trying to create pmml file for lightgbm model of around 50 MB's and tried to create pmml file from it by using the command:

java -jar ~/Downloads/jpmml-lightgbm-executable-1.2.jar --lgbm-input ~/Downloads/lgb_model_301_2021101806 --pmml-output ~/Downloads/lgb_model_301_2021101806.pmml

With this, i am seeing that my pmml file is converting categorical features to integer values. I rechecked the binary model of lightgbm and it has categorical feature values in it. So while reading this created pmml in java code, i am getting null values for categorical features as i am passing string and its expecting integers.

can you please help to tell if i am missing any parameter in above command, or if pmml is doing some kind of optimisation to reduce size of final output.

vruusmann commented 2 years ago

~/Downloads/jpmml-lightgbm-executable-1.2.jar

Does this issue happen with the latest release version (1.3.12)?

arpitswami commented 2 years ago

No, it's was not facing it 1.3.12 release. But could I have done it with 1.2 version? as upgrading version would take an additional task to do it accross the system.

vruusmann commented 2 years ago

The 1.2.X development branch was effectively finalized two years ago (oct 2019). It will not be updated.

If you have the time & resources, you may merge the HEAD of the 1.3.X development branch into it, and then keep maintaining it locally.