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

Example to load the jpmml-lightgbm file and use it to predict #18

Closed sakura7621 closed 5 years ago

sakura7621 commented 5 years ago

Hi @vruusmann,

The first thing I want to say is thank you for this project. I found it really helpful for me when I apply lightgbm for a java application.

It would be even better if I can have an example to load the light gbm pmml file, and use the model (in java version) to predict for a input data file.

Can you please give me some more document about using the output (light gbm pmml file)?

Any help would be appreciated. Thanks.

vruusmann commented 5 years ago

It would be even better if I can have an example to load the light gbm pmml file, ...

After conversion, there is no such thing as "LightGBM PMML file" or "XGBoost PMML file" - it's one standardized PMML representation for everything.

It follows that all PMML files are used for scoring exactly the same way; the PMML scoring engine doesn't need to know/care what was the original ML framework, because in PMML representation all ML models look exactly the same.

.. and use the model (in java version) to predict for a input data file.

See the documentation of your PMML scoring engine.

For example, if you're using the JPMML-Evaluator library, then everything should be nicely explained in its README file.

Short version: https://github.com/jpmml/jpmml-evaluator#basic-usage

Long version: https://github.com/jpmml/jpmml-evaluator#advanced-usage