Java library and command-line application for converting LightGBM models to PMML.
- LightGBM 2.0.0 or newer.
- Java 1.8 or newer.
Enter the project root directory and build using Apache Maven:
mvn clean install
The build produces an executable uber-JAR file target/jpmml-lightgbm-executable-1.3-SNAPSHOT.jar
.
A typical workflow can be summarized as follows:
- Use LightGBM to train a model.
- Save the model to a text file in a local filesystem.
- Use the JPMML-LightGBM command-line converter application to turn this text file to a PMML file.
Using the lightgbm
package to train a regression model for the example Boston housing dataset:
from sklearn.datasets import load_boston
boston = load_boston()
from lightgbm import LGBMRegressor
lgbm = LGBMRegressor(objective = "regression")
lgbm.fit(boston.data, boston.target, feature_name = boston.feature_names)
lgbm.booster_.save_model("lightgbm.txt")
Converting the text file lightgbm.txt
to a PMML file lightgbm.pmml
:
java -jar target/jpmml-lightgbm-executable-1.3-SNAPSHOT.jar --lgbm-input lightgbm.txt --pmml-output lightgbm.pmml
Getting help:
java -jar target/jpmml-lightgbm-executable-1.3-SNAPSHOT.jar --help
- Stacking Scikit-Learn, LightGBM and XGBoost models
- Deploying LightGBM models on Java/JVM platform
- Extending Scikit-Learn with GBDT plus LR ensemble (GBDT+LR) model type (Using LightGBM models on the GBDT side of GBDT+LR ensemble)
- Converting Scikit-Learn plus LightGBM pipelines to PMML documents
JPMML-LightGBM is licensed under the terms and conditions of the GNU Affero General Public License, Version 3.0.
If you would like to use JPMML-LightGBM in a proprietary software project, then it is possible to enter into a licensing agreement which makes JPMML-LightGBM available under the terms and conditions of the BSD 3-Clause License instead.
JPMML-LightGBM is developed and maintained by Openscoring Ltd, Estonia.
Interested in using Java PMML API software in your company? Please contact [email protected]