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

Possible to support LGBMRanker? #3

Closed travisbrady closed 5 years ago

travisbrady commented 7 years ago

Is it possible to support https://github.com/Microsoft/LightGBM/blob/master/python-package/lightgbm/sklearn.py#L639 ? If so I'd be happy to contribute, just not sure if it's even doable.

thanks

vruusmann commented 7 years ago

The doability depends on the definition of the "lambdarank" objective function - this is a piece of code that transforms the raw GBT score to the final user score.

Once known, create an appropriate subclass of org.jpmml.lightgbm.ObjectiveFunction and register it with the org.jpmml.lightgbm.GBDT#parseObjectiveFunction(...) method: https://github.com/jpmml/jpmml-lightgbm/blob/master/src/main/java/org/jpmml/lightgbm/GBDT.java#L282

travisbrady commented 7 years ago

Got it, thank you. I'll do some investigating.

mohit-shrma commented 6 years ago

Do you have any update on this?

Exception in thread "main" java.lang.IllegalArgumentException: lambdarank                                
        at org.jpmml.lightgbm.GBDT.parseObjectiveFunction(GBDT.java:338)                                 
        at org.jpmml.lightgbm.GBDT.load(GBDT.java:82)                                                    
        at org.jpmml.lightgbm.LightGBMUtil.loadGBDT(LightGBMUtil.java:58)                                
        at org.jpmml.lightgbm.LightGBMUtil.loadGBDT(LightGBMUtil.java:50)                                
        at org.jpmml.lightgbm.Main.run(Main.java:122)                                                    
        at org.jpmml.lightgbm.Main.main(Main.java:115)  
ancasarb commented 5 years ago

Are there any updates on when/if this will be supported? Thank you in advance!